CodechefAug 10, 2025

Chef and Donation

Hazrat Ali

Codechef

Since they want to end up with exactly the same amount, they decide to donate the difference between their income to a charity.

Find the amount they donate in the month.

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 income of Chef and Chefina in a month, respectively.

Output Format

For each test case, output on a new line, the amount they donate in the month.

Constraints

  • 1≤T≤100
  • 1≤X<Y≤10

Sample 1:

Input
4
1 3
2 5
4 5
2 10
Output
2
3
1
8

Solution

t = int(input())

for _ in range(t):
    x, y = map(int, input().split())
    print(y - x)






 

Comments