After the latest database upgrade, Gigatron has been restarted. Unfortunately, all the partitions are lagging!
Data pipeline team wants to spin up
Gigatron instead of having
Data pipeline wants the recovery to take at most
Constraints
Subtask 1 [1 point]
Subtask 2 [1 point]
Subtask 3 [1 point]
No additional constraints.
Input Specification
The first line of input contains two positive integers,
The next line contains
Output Specification
Output the minimum number of pods needed in order to recover in
Sample Input 1
5 4
4 3 4 3 4
Sample Output 1
5
Sample Explanation 1
We must spin up one pod per partition in this scenario.
Sample Input 2
5 100
4 3 4 3 4
Sample Output 2
3
Sample Explanation 2
If we spin up three pods, then the first pod can take the first two partitions, the second pod can take partition 3, and the last pod can take the last two partitions.
Comments