Author: | M. Sporyshev | Time limit: | 1 sec | |
Input file: | input.txt | Memory limit: | 256 Mb | |
Output file: | output.txt |
The road is a straight line. A segment of the road between points A and B is N meters long and fully illuminated by several street lamps. Each lamp can be located at any (not necessarily integer) point along the road and illuminates a segment exactly M meters long, including endpoints. If any single lamp would be turned off, at least some part of the road segment between A and B will not be illuminated any more. Lamps do not illuminate parts of the road outside of segment from A to B.
Your program must calculate maximum possible number of lamps which could be put on the road while still satisfying the conditions above.
Picture illustrates sample 3.
Input file contains integers N M.
Output file must contain a single integer — maximum number of lamps.
1 ≤ M ≤ N ≤ 109
No. | Input file (input.txt ) |
Output file (output.txt ) |
---|---|---|
1 |
|
|
2 |
|
|
3 |
|
|