#C3304. Minimal Leaps
Minimal Leaps
Minimal Leaps
This problem asks you to compute the minimal number of leaps required for a mouse to travel from a starting position a to a target position b using leaps of fixed maximum distance d. The number of leaps can be computed by the formula:
$$leaps = \lceil \frac{b - a}{d} \rceil$$
Make sure to handle the case where the remaining distance after whole leaps is non-zero, which will require one extra leap.
inputFormat
The input consists of three integers a, b, and d separated by spaces. Here, a and b represent the starting and target positions respectively, and d represents the maximum distance that can be covered in a single leap.
outputFormat
Output a single integer which is the minimal number of leaps required for the mouse to travel from a to b.
## sample0 10 3
4