#P10184. [YDOI R1] whk

[YDOI R1] whk

Background

Little Z wants to grind whk.

Problem Description

Little Z needs to grind a total of nn subjects. For the ii-th subject, he has one and only aia_i problems. There are infinitely many days available, and each day Little Z can solve infinitely many problems.

If Little Z considers a day to be interesting, it is only when on that day he solves problems from at least tt subjects.

Little Z wants to know the maximum number of interesting days.

Input Format

The first line contains 22 positive integers n,tn, t.

The next line contains nn integers: a1,a2,a3,,an1,ana_1, a_2, a_3, \dots, a_{n-1}, a_n.

Output Format

Output one integer, the maximum number of days that Little Z considers interesting.

5 3 
3 2 5 1 1 
3 
6 4 
1 1 4 5 1 4 
3 

Hint

Subtask 0 is hack testdata and is not scored.

This problem uses bundled tests.

Subtask ID nn\le aia_i\le Special property Score
11 10001000 None 2020
22 5×1055\times10^5 10510^5 t=1t=1 1010
33 11 All aia_i are 11
44 10610^6 None 6060

Constraints: for all testdata, 1tn5×1051\le t\le n\le 5\times10^5, 1ai1061\le a_i \le 10^6.

Translated by ChatGPT 5