#K48247. Cyclist Position on Track
Cyclist Position on Track
Cyclist Position on Track
You are given a circular track with a circumference \( C \) meters. A cyclist rides \( N \) meters along this track. The task is to determine the final position of the cyclist on the track. The position is measured as the distance from the start (in meters) after covering the distance \( N \). In other words, the answer is given by the formula: \( position = N \bmod C \).
For example, if a cyclist rides 100 meters on a track of circumference 50 meters, then the final position is \( 100 \bmod 50 = 0 \) meters.
You need to process multiple test cases. Each test case provides the values for \( N \) and \( C \). Use standard input and output for reading input and printing the result.
inputFormat
The first line contains an integer \( T \) representing the number of test cases. Each of the following \( T \) lines contains two space-separated integers: \( N \) (the distance in meters that the cyclist rides) and \( C \) (the circumference of the track in meters).
outputFormat
For each test case, output a single line containing the position of the cyclist on the track, computed as \( N \bmod C \).
## sample3
100 50
75 40
200 77
0
35
46
</p>