#abc363b. B - Japanese Cursed Doll
B - Japanese Cursed Doll
Score : points
问题陈述
有 个人,第 个人当前的头发长度为 ()。 每个人每天头发长度增加 。
打印出头发长度至少为 的人数首次达到 或更多时的天数。 如果现在头发长度至少为 的人数已经达到 或更多,则打印 。
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
There are people, and the current hair length of the -th person is .
Each person's hair grows by per day.
Print the number of days after which the number of people whose hair length is at least becomes or more for the first time.
If there are already or more people whose hair length is at least now, print .
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the number of days after which the number of people whose hair length is at least becomes or more for the first time. If this condition is already satisfied now, print .
Sample Input 1
5 10 3
3 11 1 6 2
Sample Output 1
7
There are five people, and their current hair lengths are , so there is one person whose hair length is at least .
After seven days, the hair lengths of the people will be , respectively, and there will be three people whose hair length is at least .
After six days, there are only two people whose hair length is at least , not satisfying the condition, so print .
Sample Input 2
2 5 2
10 10
Sample Output 2
0
Since there are already two people whose hair length is at least now, satisfying the condition, so print .
Sample Input 3
3 10 1
1 2 3
Sample Output 3
7