The summer is at its peak in Chefland. Chef is planning to purchase a water cooler to keep his room cool. He has two options available: 
Rent a cooler at the cost of X coins per month.
Purchase a cooler for Y coins.

Chef wonders what is the maximum number of months for which he can rent the cooler such that the cost of renting is strictly less than the cost of purchasing it.

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

- The first line of input will contain an integer T — the number of test cases. The description of T test cases follows.
- The first and only line of each test case contains two integers X and Y, as described in the problem statement. 

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

For each test case, output the maximum number of months for which he can rent the cooler such that the cost of renting is strictly less than the cost of purchasing it. 

If Chef should not rent a cooler at all, output 0.

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

$1 ≤ T ≤ 1000$
$1 ≤ X, Y ≤ 10^{9}$

----- Sample Input 1 ------ 
2
5 12
5 5
----- Sample Output 1 ------ 
2
0
----- explanation 1 ------ 
Test case $1$: Cost of renting the cooler $= 5$ coins per month. Cost of purchasing the cooler $= 12$ coins. So, Chef can rent the cooler for $2$ months at the cost of $10$ coins, which is strictly less than $12$ coins.

Test case $2$: Cost of renting the cooler $= 5$ coins per month. Cost of purchasing the cooler $= 5$ coins. If Chef rents the cooler for $1$ month, it will cost $5$ coins, which is not strictly less than the cost of purchasing it. So, Chef should not rent the cooler.

Source: codechef | Difficulty: EASY
Tags: Mathematics


Solutions:
for i in range(int(input())):
	(x, y) = map(int, input().split())
	if x >= y:
		print(0)
	else:
		s = y // x
		if y % x == 0:
			s -= 1
		print(s)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	c = int(b / a)
	if b <= a:
		print('0')
	else:
		m = b // a
		if b % a == 0:
			m -= 1
		print(m)


for i in range(int(input())):
	(rent, new) = map(int, input().split(' '))
	if new == rent:
		print(0)
	elif new % rent == 0:
		print(new // rent - 1)
	else:
		print(new // rent)


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	if b % a != 0:
		print(int(b / a))
	else:
		print(int(b / a) - 1)


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


for _ in range(int(input())):
	(r, p) = map(int, input().split())
	m = p // r - (1 if p % r == 0 else 0)
	print(m)


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


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


import math
t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	k = y / x
	l = math.ceil(k)
	print(l - 1)


t = int(input())
for _ in range(t):
	(x, y) = map(int, input().split())
	count = 0
	if x >= y:
		print(0)
	else:
		m = y // x
		if y % x == 0:
			m -= 1
		print(m)


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


for t in range(int(input())):
	(x, y) = map(int, input().split())
	if y > x:
		mon = y // x
		if y % x == 0:
			mon -= 1
		print(mon)
	else:
		print(0)


import math
n = int(input())
c = 1
for i in range(n):
	(a, b) = list(map(int, input().split()))
	if a == b:
		print('0')
	else:
		print(math.ceil(b / a) - 1)


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


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


t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	d = y // x
	if d * x == y:
		print(d - 1)
	else:
		print(d)


t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	rent = x * (y // x)
	cost = y
	if rent < cost:
		print(y // x)
	else:
		print(y // x - 1)


for t in range(int(input())):
	(rent, purchase) = map(int, input().split())
	if rent >= purchase:
		print('0')
	else:
		count = purchase // rent
		if purchase % rent == 0:
			count -= 1
		print(count)


T = int(input())
for _ in range(T):
	(X, Y) = map(int, input().split())
	if Y % X == 0:
		print(Y // X - 1)
	else:
		print(Y // X)


for _ in range(int(input())):
	(a, y) = map(int, input().split())
	if y % a == 0:
		print(y // a - 1)
	else:
		print(y // a)


t = int(input())
while t > 0:
	t = t - 1
	(a, b) = map(int, input().split())
	if b % a == 0:
		print(b // a - 1)
	else:
		print(b // a)


T = int(input())
for _ in range(T):
	(X, Y) = map(int, input().split())
	if X == Y:
		print(0)
	elif X < Y:
		result_div = Y / X
		result_floordiv = Y // X
		if result_div > result_floordiv:
			print(result_floordiv)
		elif result_div == result_floordiv:
			print(result_floordiv - 1)
	else:
		print(0)


for i in range(int(input())):
	(x, y) = map(int, input().split())
	if y > x:
		a = y / x
		if y % x == 0:
			a = a - 1
		print(int(a))
	elif y == x or y < x:
		print(0)


def code():
	cases = int(input())
	for _ in range(cases):
		(X, Y) = map(int, input().split(' '))
		cur_cost = 0
		months = Y // X
		if Y % X != 0:
			print(Y // X)
		else:
			print(int(Y / X - 1))
code()


t = int(input())
for _ in range(t):
	(x, y) = map(int, input().split())
	if y % x:
		print(y // x)
	else:
		print(y // x - 1)


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


import sys
test = int(input())
while test > 0:
	(x, y) = [int(x) for x in sys.stdin.readline().rstrip('\n').split()]
	if y % x != 0:
		print(y // x)
	else:
		print(y // x - 1)
	test -= 1


a = int(input())
for i in range(a):
	b = input().split(' ')
	x = int(b[0])
	y = int(b[1])
	if y % x == 0:
		print(y // x - 1)
	else:
		print(y // x)