#P7557. Boosting the h-Index
Boosting the h-Index
Boosting the h-Index
Bessie, a passionate computer scientist aspiring to be "Dr. Bessie", has published N research papers with citation counts \(c_1, c_2, \dots, c_N\). The h-index is defined as the maximum integer \(h\) such that the researcher has at least \(h\) papers with at least \(h\) citations each.
Currently, Bessie’s \(h\)-index is calculated from her published papers. To boost her \(h\)-index, she plans to write at most \(K\) survey papers. In each survey, due to page limits, she can cite at most \(L\) of her own research papers (and each paper may be cited at most once per survey). Note that while each paper can receive at most one extra citation per survey (i.e. at most \(K\) extra citations overall), the surveys are subject to the overall restriction that in total she cannot add more than \(K \times L\) extra citations.
Your task is to compute the maximum possible \(h\)-index that Bessie can achieve if she distributes these survey citations optimally. (Remember that survey papers themselves do not count when computing the \(h\)-index.)
Note: Although Bessie’s advisor mentioned that writing surveys solely to boost one's h-index might raise ethical concerns, this problem is for algorithmic practice only.
inputFormat
The first line contains three integers \(N\), \(K\), and \(L\) (1 ≤ N ≤ 105, 0 ≤ K, L ≤ 105).
The second line contains \(N\) space-separated integers \(c_1, c_2, \dots, c_N\) (0 ≤ ci ≤ 105), representing the citation counts of each paper.
outputFormat
Output a single integer — the maximum achievable \(h\)-index after optimally adding survey citations.
sample
4 0 0
1 100 2 3
2
</p>