An SDE is planning focused deep work sessions for the next
On day
They want to choose exactly
The total productivity is the sum of
Your task is to find the maximum possible value of
If it is impossible even for
The first line contains three integers KaTeX can only parse string typed expression, KaTeX can only parse string typed expression, and KaTeX can only parse string typed expression — the number of days, the number of work sprints, and the required total productivity.
The second line contains KaTeX can only parse string typed expression integers KaTeX can only parse string typed expression — the productive work units for each day.
Print a single integer — the maximum sprint length KaTeX can only parse string typed expression such that exactly KaTeX can only parse string typed expression non-overlapping sprints of length at least KaTeX can only parse string typed expression can achieve total productivity at least KaTeX can only parse string typed expression.
Input
7 2 18
3 2 7 10 1 4 6Output3ExplanationFor KaTeX can only parse string typed expression, choose sprint KaTeX can only parse string typed expression with productivity KaTeX can only parse string typed expression and sprint KaTeX can only parse string typed expression with productivity KaTeX can only parse string typed expression. The total productivity is KaTeX can only parse string typed expression, which is at least KaTeX can only parse string typed expression.
For KaTeX can only parse string typed expression, it is impossible to choose exactly KaTeX can only parse string typed expression non-overlapping sprints because at least KaTeX can only parse string typed expression days are required, but only KaTeX can only parse string typed expression days are available.
Therefore, the maximum valid value of KaTeX can only parse string typed expression is KaTeX can only parse string typed expression.