Chef's coding class is very famous in Chefland. 

This year X students joined his class and each student will require one chair to sit on. Chef already has Y chairs in his class. Determine the minimum number of new chairs Chef must buy so that every student is able to get one chair to sit on.

------ Input Format ------ 

- The first line contains a single integer T — the number of test cases. Then the test cases follow.
- The first and only line of each test case contains two integers X and Y — the number of students in the class and the number of chairs Chef already has.

------ Output Format ------ 

For each test case, output the minimum number of extra chairs Chef must buy so that every student gets one chair.

------ Constraints ------ 

$1 ≤ T ≤ 1000$
$0 ≤ X, Y ≤ 100$

----- Sample Input 1 ------ 
4
20 14
41 41
35 0
50 100

----- Sample Output 1 ------ 
6
0
35
0

----- explanation 1 ------ 
- Test case 1: There are $20$ students in the class and Chef has $14$ chairs already. Therefore Chef must buy $6$ more chairs.
- Test case 2: There are $41$ students in the class and Chef already has exactly $41$ chairs. Therefore Chef does not need to buy any more chairs.
- Test case 3: There are $35$ students in the class and Chef has no chairs initially. Therefore Chef must buy $35$ chairs.

Source: codechef | Difficulty: EASY
Tags: Mathematics

Implementation


Solutions:
t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	if x <= y:
		print('0')
	else:
		print(x - y)


t = int(input())
for _ in range(t):
	(X, Y) = map(int, input().split())
	if X > Y:
		print(X - Y)
	else:
		print(0)


for i in range(int(input())):
	(a, b) = map(int, input().split())
	if a > b:
		print(a - b)
	else:
		print(0)


t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	if n > m:
		print(n - m)
	else:
		print('0')


t = int(input())
for _ in range(t):
	(a, b) = input().split()
	d = int(a) - int(b)
	print(d if d >= 0 else 0)


t = int(input())
for u in range(t):
	(X, Y) = list(map(int, input().split()))
	if X > Y:
		print(X - Y)
	else:
		print(0)


for t in range(int(input())):
	(i, j) = map(int, input().split(' '))
	if j < i:
		print(i - j)
	else:
		print(0)


T = int(input())
for i in range(T):
	(X, Y) = map(int, input().split())
	if X - Y >= 0:
		print(X - Y)
	else:
		print(0)


n = int(input())
for i in range(n):
	(p, q) = map(int, input().split())
	print(p - q) if p >= q else print('0')


t = int(input())
while t:
	(x, y) = map(int, input().split())
	if y >= x:
		print(0)
	else:
		print(x - y)
	t -= 1


test = int(input())
ans = []
while test:
	test = test - 1
	(X, Y) = [int(x) for x in input().split()]
	if X > Y:
		ans.append(X - Y)
	else:
		ans.append(0)
for i in ans:
	print(i)


n = int(input())
for _ in range(n):
	(a, b) = map(int, input().split())
	if a > b:
		print(a - b)
	else:
		print(0)


Test = int(input())
for i in range(Test):
	(x0, y0) = map(int, input().split())
	if y0 > x0:
		print(0)
	else:
		print(x0 - y0)


t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	extra_chairs = max(x - y, 0)
	print(extra_chairs)


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	if x > y:
		print(x - y)
	else:
		print('0')


test_cases = int(input())
for i in range(test_cases):
	chairs = list(map(int, input().split()))
	if chairs[0] < chairs[-1]:
		print(0)
	else:
		print(chairs[0] - chairs[-1])


t = int(input())
for i in range(t):
	(M, N) = map(int, input().split())
	if N > M:
		print(0)
	else:
		print(M - N)


t = int(input())
for _ in range(t):
	(x, y) = [int(x) for x in input().split()]
	if x > y:
		c = x - y
		print(c)
	else:
		print('0')


n = int(input())
for i in range(n):
	(x, y) = map(int, input().split())
	a = x - y
	if x < y:
		print('0')
	else:
		print(a)


for t in range(int(input())):
	(s, k) = map(int, input().split())
	if s >= k:
		print(abs(s - k))
	else:
		print(0)


n = int(input())
while n > 0:
	(a, b) = map(int, input().split())
	if a < b:
		print('0')
	else:
		print(a - b)
	n -= 1


n = int(input())
for i in range(n):
	(x, y) = map(int, input().split())
	if x - y >= 0:
		print(x - y)
	elif x - y < 0:
		print('0')


T = int(input())
for i in range(T):
	(x, y) = map(int, input().split())
	if x > y:
		num_chair = x - y
	else:
		num_chair = 0
	print(num_chair)


T = int(input())
for t in range(T):
	(X, Y) = map(int, input().split())
	q = X - Y
	if q >= 0:
		print(q)
	else:
		print(0)


T = int(input())
for tc in range(T):
	(x, y) = map(int, input().split())
	if x > y:
		print(x - y)
	else:
		print(0)