#abc365c. C - Transportation Expenses
C - Transportation Expenses
Score : points
问题陈述
有 个人参加一个活动,第 个人的交通费用是 日元。
活动组织者高桥决定设定一个交通补贴的最大限额 。第 个人的补贴将是 日元。这里, 必须是一个非负整数。
已知高桥的预算是 日元,他希望所有 个人的总交通补贴最多为 日元,那么补贴限额 的最大可能值是多少?
如果补贴限额可以无限大,那么请报告这一点。
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
There are people participating in an event, and the transportation cost for the -th person is yen.
Takahashi, the organizer of the event, decided to set a maximum limit for the transportation subsidy. The subsidy for person will be yen. Here, must be a non-negative integer.
Given that Takahashi's budget is yen, and he wants the total transportation subsidy for all people to be at most yen, what is the maximum possible value of the subsidy limit ?
If the subsidy limit can be made infinitely large, report that instead.
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the maximum value of the subsidy limit that satisfies the budget condition, as an integer.
If the subsidy limit can be made infinitely large, print infinite
instead.
Sample Input 1
4 8
1 3 2 4
Sample Output 1
2
If the subsidy limit is set to yen, the total transportation subsidy for all people is yen, which is within the budget of yen.
If the subsidy limit is set to yen, the total transportation subsidy for all people is yen, which exceeds the budget of yen.
Therefore, the maximum possible value of the subsidy limit is yen.
Sample Input 2
3 20
5 3 2
Sample Output 2
infinite
The subsidy limit can be made infinitely large.
Sample Input 3
10 23
2 5 6 5 2 1 7 9 7 2
Sample Output 3
2