atcoder#ARC134A. [ARC134A] Bridge and Sheets
[ARC134A] Bridge and Sheets
Score : points
Problem Statement
Snuke bought a bridge of length . He decided to cover this bridge with blue tarps of length each.
Below, a position on the bridge is represented by the distance from the left end of the bridge. When a tarp is placed so that its left end is at the position (, is real), it covers the range . (Note that both ends are included.)
He has already placed tarps. The left end of the -th tarp is at the position .
At least how many more tarps are needed to cover the bridge entirely? Here, the bridge is said to be covered entirely when, for any real number between and (inclusive), there is a tarp that covers the position .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the minimum number of tarps needed to cover the bridge entirely.
2 10 3
3 5
2
- The bridge will be covered entirely by, for example, placing two tarps so that their left ends are at the positions and .
5 10 3
0 1 4 6 7
0
12 1000000000 5
18501490 45193578 51176297 126259763 132941437 180230259 401450156 585843095 614520250 622477699 657221699 896711402
199999992