Codechef•Jul 18, 2025
Kitchen Timings
Hazrat Ali
Codechef
Find the number of hours Chef works.
Input Format
- The first line of input will contain a single integer T, denoting the number of test cases.
- Each test case consists of two space-separated integers X and Y — the starting and ending time of working hours respectively.
Output Format
For each test case, output on a new line, the number of hours Chef works.
Constraints
- 1≤T≤100
- 1≤X<Y≤12
Sample 1:
Input
4 1 2 3 7 9 11 2 10
Output
1 4 2 8
Solution
T = int(input())
for _ in range(T):
X, Y = map(int, input().split())
print(Y - X)