In Chefland, everyone who earns strictly more than Y rupees per year, has to pay a tax to Chef. Chef has allowed a special scheme where you can invest any amount of money and claim exemption for it.

You have earned X (X > Y) rupees this year. Find the minimum amount of money you have to invest so that you don't have to pay taxes this year.

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

- The first line of input will contain a single integer T, denoting the number of test cases.
- Each test case consists of a single line of input consisting of two space separated integers X and Y denoting the amount you earned and the amount above which you will have to pay taxes.

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

For each test case, output a single integer, denoting the minimum amount you need to invest.

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

$1 ≤ T ≤ 100$
$1 ≤ Y < X ≤ 100$

----- Sample Input 1 ------ 
4
4 2
8 7
5 1
2 1

----- Sample Output 1 ------ 
2
1
4
1

----- explanation 1 ------ 
Test case $1$: The amount above which you will have to pay taxes is $2$. Since you earn $4$ rupees, you need to invest at least $2$ rupees. After investing $2$ rupees, you will remain with an effective income $4 - 2 = 2$ rupees which will not be taxed.

Test case $2$: The amount above which you will have to pay taxes is $7$. Since you earn $8$ rupees, you need to invest at least $1$ rupees.

Test case $3$: The amount above which you will have to pay taxes is $1$. Since you earn $5$ rupees, you need to invest at least $4$ rupees.

Test case $4$: The amount above which you will have to pay taxes is $1$. Since you earn $2$ rupees, you need to invest at least $1$ rupees.

Source: codechef | Difficulty: EASY
Tags: Mathematics


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


for i in range(int(input())):
	(m, n) = list(map(int, input().split()))
	print(m - n)


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


a = int(input())
for i in range(1, a + 1):
	(x, y) = map(int, input().split())
	print(x - y)


for i in range(int(input())):
	(X, Y) = map(int, input().split())
	print(X - Y)


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


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


test = int(input())
for i in range(test):
	numbers = input()
	(x, y) = map(int, numbers.split())
	print(x - y)


n = int(input())
for i in range(n):
	lst = list(map(int, input().split()))[:n]
	print(lst[0] - lst[1])


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


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


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


T = int(input())
for i in range(T):
	(X, Y) = map(int, input().split())
	tax = X - Y
	print(tax)


T = int(input())
for i in range(T):
	line = input().split()
	X = int(line[0])
	Y = int(line[1])
	print(X - Y)


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split(' '))
	print(abs(a - b))


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


x = int(input())
for i in range(x):
	(a, b) = map(int, input().split())
	c = a - b
	print(c)


for _ in range(int(input())):
	(X, Y) = map(int, input().split())
	c = X - Y
	print(abs(c))


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


T = int(input())
for y in range(0, T):
	(X, Y) = [int(x) for x in input().split()]
	minimum = X - Y
	print(minimum)


n = int(input())
k = 0
for i in range(n):
	(a, b) = list(map(int, input().split()))
	k = a - b
	print(k)


for x in range(int(input())):
	(a, b) = map(int, input().split())
	print(a - b)


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


t = int(input())
for i in range(t):
	(X, Y) = map(int, input().split())
	exemption = X - Y
	print(exemption)


for t in range(int(input())):
	(X, Y) = map(int, input().split())
	diff = X - Y
	print(diff)


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


t = int(input())

def tax(t):
	x = []
	for i in range(1, t + 1):
		a = list(map(int, input().split()))
		x.append(a)
	for j in x:
		(m, n) = j
		if m > n:
			print(m - n)
tax(t)


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


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


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


T = int(input())
for Ti in range(T):
	(X, Y) = map(int, input().split(' '))
	invest = X - Y
	print(invest)


t = int(input())
for i in range(0, t):
	x = list(map(int, input().split()))
	print(x[0] - x[1])


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


T = int(input())
for X in range(T):
	(X, Y) = map(int, input().split())
	R = X - Y
	print(R)


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


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


l = []
n = int(input())
for i in range(n):
	(x, y) = map(int, input().split())
	z = x - y
	l.append(z)
print(*l, sep='\n')