#P1589. 泥泞路
泥泞路
Description
After a heavy rain, there are some muddy segments on the road from FJ's farm to the town. He has several planks, each of length , that can be laid over these muddy segments. Find the minimum number of planks required to cover all the muddy segments.
Input Format
The first line contains positive integers and , representing the number of muddy segments and the length of a plank.
The next lines each contain two integers and , representing the start and end of a muddy segment.
Output Format
A single positive integer, the number of planks.
3 3
1 6
13 17
8 12
5
Hint
For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号