Minimum Soldering Speed
There are boards; board has joints to solder. You solder at a fixed speed of joints per hour, working on one board per hour (if a board has fewer than joints left, you finish it and rest for the rest of that hour). What is the smallest integer that finishes everything within hours?
Try binary search on the answer.
Input
, then , then .
Output
The minimum speed .
Constraints
, ,
Sample 1
Input
4 3 6 7 11 8
Output
4
Sample 2
Input
5 30 11 23 4 20 5
Output
30