Олимпиадный тренинг

Задача 38128. Acowdemia


Besi has published N articles (1 <= N <= 105). ith article cited ci times (0 <= ci <=  ;105).
h-index is the largest number of h such that there are at least h articles, each of which is cited by at least h code> times. For example, there are 4 articles with the number of citations (1,100,2,3), then the h-index is 2, and with the number of citations (1,100,3,3) h- index is 3.

To increase her h-index, Besi plans to write K review articles (0 <= K <= 105), each of which cites several of her past articles. Besi has the right to cite no more than L articles in each review (0 <= L <= 105). Of course, no article can be cited more than once in one review (however, an article can be cited in several reviews).

Help Besi determine the maximum h-index she can reach after writing these review articles. Besi cannot quote a review in any of her reviews.

Input data
The first line contains N, K, L. The second line contains N space-separated integers c1, ...,cN.

Imprint
Maximum h-index.
 
Examples
# Input Output Explanation
1 4 4 1
1 100 1 1
3 In this example, Besi can write 4 review articles, each of which can cite no more than 1 article. If you quote the first and third articles 2 times, its h-index becomes 3.
2 4 1 4
1 100 1 1
2 In this second example, Besi can write at most one article. If Besi cites any of her 1st, 2nd or 4th articles at least once, her h-index will become 2.