#K69392. Time to Return to Start
Time to Return to Start
Time to Return to Start
Alex is running on a circular track with a total circumference of n meters. Starting at position p, he runs at a constant speed of v meters per minute. Your task is to determine the number of minutes it will take for Alex to return to the starting point (position 0) assuming he continues to run in the same direction.
Mathematically, the time required is given by \(\lceil \frac{n-p}{v} \rceil\), where \(\lceil x \rceil\) denotes the ceiling function, i.e., the smallest integer greater than or equal to \(x\).
For example, if \(n=100,\; p=25,\; v=20\), then the time required is \(\lceil \frac{75}{20} \rceil = 4\) minutes.
inputFormat
The input consists of a single line containing three space-separated integers:
- n (1 ≤ n ≤ 109): the circumference of the track in meters.
- p (0 ≤ p < n): the current position of Alex on the track in meters.
- v (1 ≤ v ≤ 109): the speed of Alex in meters per minute.
You should read the input from standard input (stdin).
outputFormat
Output a single integer: the number of minutes it will take for Alex to return to the starting point (position 0). The result should be printed to standard output (stdout).
## sample100 25 20
4
</p>