Chef has closed his restaurant and decided to run a fruit stand instead. His signature dish is a fruit chaat consisting of 2 bananas and 1 apple. He currently has X bananas and Y apples. How many chaats can he make with the fruits he currently has? 

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

- The first line will contain T, the number of testcases. Then the testcases follow.
- Each testcase consists of a single line containing two space separated integers - X and Y

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

For each testcase, output the answer on a new line. 

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

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

----- Sample Input 1 ------ 
3
72 50
38 93
51 4
----- Sample Output 1 ------ 
36
19
4

----- explanation 1 ------ 
Test Case $1$: Chef can make $36$ chaats using $72$ bananas and $36$ apples.

Test Case $2$: Chef can make $19$ chaats using $38$ bananas and $19$ apples.

Test Case $3$: Chef can make $4$ chaats using $8$ bananas and $4$ apples.

Source: codechef | Difficulty: EASY
Tags: Mathematics


Solutions:
for j in range(int(input())):
	(x, y) = map(int, input().split())
	a = x // 2
	if a < y:
		print(a)
	else:
		print(y)


for i in range(int(input())):
	(x, y) = map(int, input().split())
	if y < x // 2:
		print(y)
	else:
		print(x // 2)


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


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


n = int(input())
for i in range(n):
	c = 0
	(x, y) = map(int, input().split())
	while x > 1 and y > 0:
		c += 1
		x -= 2
		y -= 1
	print(c)


for i in range(int(input())):
	(x, y) = map(int, input().split())
	print(min(x // 2, y))


t = int(input())
for _ in range(t):
	(X, Y) = map(int, input().split())
	if X // 2 < Y:
		print(X // 2)
	else:
		print(Y)


for i in range(int(input())):
	(a, b) = map(int, input().split())
	a_res = a // 2
	b_res = b // 2
	if a_res <= b:
		print(a_res)
	else:
		print(b)


t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	a = x // 2
	b = y
	print(min(a, b))


n = int(input())
for _ in range(n):
	(x, y) = list(map(int, input().split()))
	print(min(x // 2, y // 1))


for i in range(int(input())):
	(m, n) = map(int, input().split())
	print(min(m // 2, n))


for t in range(int(input())):
	(x, y) = map(int, input().split())
	ba = x // 2
	print(min(y, ba))


t = int(input())
i = 1
while i <= t:
	i += 1
	(b, a) = map(int, input().split())
	c = b // 2
	if c > a:
		print(a)
	else:
		print(c)


T = int(input())
for i in range(T):
	(X, Y) = map(int, input().split())
	a = X // 2
	b = Y // 1
	print(min(a, b))


n = int(input())
for i in range(n):
	(a, b) = list(map(int, input().split()))
	if a // 2 <= b:
		print(a // 2)
	else:
		print(b)


t = int(input())
while t > 0:
	t = t - 1
	(x, y) = map(int, input().split())
	z = x // 2
	print(min(z, y))


t = int(input())
for i in range(t):
	(x, y) = [int(i) for i in input().split()]
	b = x // 2
	if b > y:
		print(y)
	elif y > b:
		print(b)
	elif b == y:
		print(b)


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


for _ in range(int(input())):
	(N, X) = map(int, input().split())
	final = int(N / 2)
	print(final) if final < X else print(X)


for t in range(int(input())):
	(bananas, apples) = map(int, input().split())
	count = 0
	while bananas >= 2 and apples >= 1:
		count += 1
		bananas -= 2
		apples -= 1
		pass
	print(count)


t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	banana = x // 2
	apple = y
	if apple > banana:
		print(banana)
	else:
		print(apple)


import math

def solution():
	pass
T = int(input())
for _ in range(T):
	(X, Y) = map(int, input().split())
	if X // 2 <= Y:
		print(X // 2)
	else:
		print(Y)


T = int(input())
for _ in range(T):
	(X, Y) = map(int, input().split())
	bananas_per_dish = X // 2
	apples_per_dish = Y
	print(min(bananas_per_dish, apples_per_dish))


n = int(input())
for i in range(n):
	(x, y) = map(int, input().split())
	if x > y and x // 2 >= y:
		print(y)
	elif 2 * x == y:
		print(y)
	elif (x, y):
		print(x // 2)


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


def chs(x, y):
	c = x // 2
	if y < c:
		print(y)
	else:
		print(c)
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	ans = chs(a, b)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	print(min(a // 2, b))


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


t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	z = x // 2
	if z < y:
		print(z)
	elif y > x:
		print(x // 2)
	else:
		print(y)


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	c = min(x // 2, y // 1)
	print(c)


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


for i in range(int(input())):
	(banan, app) = map(int, input().split())
	if banan >= 2 * app:
		print(app)
	elif banan <= 2 * app:
		print(int(0.5 * banan))


T = int(input())
for i in range(T):
	(X, Y) = map(int, input().split())
	if Y < X // 2:
		print(Y)
	else:
		print(X // 2)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a / 2 <= b:
		print(int(a / 2))
	else:
		print(b)