#abc363b. B - Japanese Cursed Doll

B - Japanese Cursed Doll

Score : 200200 points

问题陈述

NN 个人,第 ii 个人当前的头发长度为 LiL_i1iN1 \leq i \leq N)。 每个人每天头发长度增加 11

打印出头发长度至少为 TT 的人数首次达到 PP 或更多时的天数。 如果现在头发长度至少为 TT 的人数已经达到 PP 或更多,则打印 00

以上为大语言模型 kimi 翻译,仅供参考。

Problem Statement

There are NN people, and the current hair length of the ii-th person (1iN)(1 \leq i \leq N) is LiL_i.
Each person's hair grows by 11 per day.

Print the number of days after which the number of people whose hair length is at least TT becomes PP or more for the first time.
If there are already PP or more people whose hair length is at least TT now, print 00.

Constraints

  • 1N1001 \leq N \leq 100
  • 1Li1001 \leq L_i \leq 100
  • 1T1001 \leq T \leq 100
  • 1PN1 \leq P \leq N
  • All input values are integers.

Input

The input is given from Standard Input in the following format:

NN TT PP

L1L_1 L2L_2 \ldots LNL_N

Output

Print the number of days after which the number of people whose hair length is at least TT becomes PP or more for the first time. If this condition is already satisfied now, print 00.

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 3,11,1,6,23, 11, 1, 6, 2, so there is one person whose hair length is at least 1010.

After seven days, the hair lengths of the people will be 10,18,8,13,910, 18, 8, 13, 9, respectively, and there will be three people whose hair length is at least 1010.
After six days, there are only two people whose hair length is at least 1010, not satisfying the condition, so print 77.

Sample Input 2

2 5 2
10 10

Sample Output 2

0

Since there are already two people whose hair length is at least 55 now, satisfying the condition, so print 00.

Sample Input 3

3 10 1
1 2 3

Sample Output 3

7
}