#C3716. Remaining Marathon Time
Remaining Marathon Time
Remaining Marathon Time
In this problem, each participant in a marathon is given a total time limit to finish the race. Given the total allowed time (L) and the time already spent (C), your task is to calculate the remaining time (T_{remaining}) that the participant has to complete the marathon. The formula to compute the remaining time is given by: [ T_{remaining} = L - C ] It is guaranteed that the current time spent is less than or equal to the time limit. Input is provided as multiple test cases, and for each test case, you need to output the remaining time on a separate line.
Example:
If the input is:
4
300 120
180 90
150 145
100 60
The output should be:
180
90
5
40
inputFormat
The first line contains an integer (T) representing the number of test cases. This is followed by (T) lines, each containing two space-separated integers (L) and (C), where (L) is the total time limit for the marathon and (C) is the time already spent by the participant.
outputFormat
For each test case, output a single integer denoting the remaining time (T_{remaining} = L - C) on a separate line.## sample
4
300 120
180 90
150 145
100 60
180
90
5
40
</p>