Each pizza consists of 4 slices. There are N friends and each friend needs exactly X slices. 

Find the minimum number of pizzas they should order to satisfy their appetite.

------ 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 integers N and X, the number of friends and the number of slices each friend wants respectively.

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

For each test case, output the minimum number of pizzas required.

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

$1 ≤ T ≤ 100$
$1 ≤ N, X ≤ 10$

----- Sample Input 1 ------ 
4
1 5
2 6
4 3
3 5

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

----- explanation 1 ------ 
Test case $1$: There is only $1$ friend who requires $5$ slices. If he orders $1$ pizza, he will get only $4$ slices. Thus, at least $2$ pizzas should be ordered to have required number of slices.

Test case $2$: There are $2$ friends who require $6$ slices each. Thus, total $12$ slices are required. To get $12$ slices, they should order $3$ pizzas.

Test case $3$: There are $4$ friends who require $3$ slices each. Thus, total $12$ slices are required. To get $12$ slices, they should order $3$ pizzas.

Test case $4$: There are $3$ friends who require $5$ slices each. Thus, total $15$ slices are required. To get $15$ slices, they should order at least $4$ pizzas.

Source: codechef | Difficulty: EASY
Tags: Mathematics


Solutions:
import math
for i in range(int(input())):
	(x, y) = map(int, input().split())
	a = x * y
	print(math.ceil(a / 4))


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


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


import math
t = int(input())
for i in range(t):
	(n, x) = [int(x) for x in input().split()]
	print(math.ceil(n * x / 4))


import math
for i in range(int(input())):
	(a, b) = map(int, input().split())
	print(math.ceil(a * b / 4))


from math import ceil
n = int(input())
for i in range(n):
	(a, x) = map(int, input().split())
	a = a * x
	if a % 4:
		print(a // 4 + 1)
	else:
		print(a // 4)


t = int(input())
for r in range(t):
	(n, x) = map(int, input().split(' '))
	pizza = n * x // 4
	if n * x % 4 == 0:
		print(pizza)
	else:
		print(pizza + 1)


for _ in range(int(input())):
	(n, x) = map(int, input().split())
	t = n * x
	z = t / 4
	if t % 4 == 0:
		print(t // 4)
	else:
		print(t // 4 + 1)


t = int(input())
for t in range(t):
	(n, x) = map(int, input().split())
	a = n * x % 4
	if a == 0:
		print(n * x // 4)
	else:
		print(n * x // 4 + 1)


for i in range(int(input())):
	(n, x) = map(int, input().split())
	p = n * x // 4
	if n * x % 4 == 0:
		print(p)
	else:
		print(p + 1)


t = int(input())
for i in range(t):
	(N, X) = map(int, input().split())
	Z = int(N * X // 4)
	if N * X % 4 == 0:
		print(Z)
	else:
		print(Z + 1)


x = int(input())
for i in range(x):
	(a, b) = map(int, input().split())
	z = a * b
	w = z // 4
	if z % 4 < 4 and z % 4 > 0:
		w = w + 1
	print(w)


k = int(input())
for i in range(k):
	(m, x) = map(int, input().split())
	o = m * x
	if o % 4 == 0:
		print(o // 4)
	else:
		print(o // 4 + 1)


t = int(input())
for i in range(t):
	(n, x) = map(int, input().split())
	o = n * x
	if o % 4 == 0:
		print(o // 4)
	else:
		print(o // 4 + 1)


import math
for t in range(int(input())):
	(N, X) = map(int, input().split())
	s = math.ceil(N * X / 4)
	print(s)


t = int(input())
for i in range(t):
	(n, x) = map(int, input().split())
	p = n * x
	if p % 4 == 0:
		print(p // 4)
	elif p % 4 != 0:
		print(p // 4 + 1)


T = int(input())
for i in range(T):
	(N, X) = map(int, input().split())
	if N * X / 4 > N * X // 4:
		print(N * X // 4 + 1)
	else:
		print(N * X // 4)


t = int(input())
while t:
	(n, x) = map(int, input().split())
	print(n * x // 4 + 1 if n * x % 4 != 0 else n * x // 4)
	t -= 1


n = int(input())
for c in range(n):
	(k, a) = map(int, input().split(' '))
	pizza = k * a // 4
	if k * a % 4 == 0:
		print(pizza)
	else:
		print(pizza + 1)


f = int(input())
for i in range(f):
	(n, x) = map(int, input().split())
	a = n * x
	if a % 4 == 0:
		print(n * x // 4)
	else:
		print(n * x // 4 + 1)


import math
n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	c = a * b
	d = math.ceil(c / 4)
	print(d)


T = int(input())
for tc in range(T):
	(n, x) = map(int, input().split(' '))
	pizza = n * x // 4
	if n * x % 4 == 0:
		print(pizza)
	else:
		print(pizza + 1)


for _ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	p = a * b // 4
	if a * b % 4 == 0:
		print(p)
	else:
		print(p + 1)


def pizzas(n, x):
	s = n * x
	r = s % 4
	p = s // 4
	if r == 0:
		return p
	else:
		return p + 1
t = int(input())
for i in range(1, t + 1):
	(n, x) = map(int, input().split())
	res = pizzas(n, x)
	print(res)


for i in range(int(input())):
	(N, X) = map(int, input().split())
	noOfSlices = N * X
	print(int(noOfSlices / 4) if noOfSlices % 4 == 0 else int(noOfSlices / 4) + 1)


t = int(input())
for i in range(t):
	(n, x) = map(int, input().split())
	r = n * x
	(y, z) = divmod(r, 4)
	if z == 0:
		print(y)
	else:
		print(y + 1)


T = int(input())
for i in range(T):
	(N, X) = map(int, input().split())
	T = N * X
	(y, z) = divmod(T, 4)
	if z == 0:
		print(y)
	else:
		print(y + 1)


import math
T = int(input())
for i in range(T):
	(N, X) = map(int, input().split())
	print(math.ceil(N * X / 4))


t = int(input())
for i in range(t):
	(n, x) = map(int, input().split())
	c = n * x
	g = c // 4
	f = c % 4
	if f == 0:
		print(g)
	else:
		print(g + 1)


t = int(input())
while t != 0:
	(a, b) = map(int, input().split())
	s = a * b / 4
	d = a * b // 4
	if s > d:
		print(d + 1)
	else:
		print(d)
	t = t - 1


for i in range(int(input())):
	(a, b) = list(map(int, input().split()))
	x = 4
	c = a * b // x
	if a * b % x == 0:
		print(c)
	else:
		print(c + 1)


import math
t = int(input())
for i in range(t):
	(n, x) = list(map(int, input().split()))
	val = n * x
	div = val / 4
	ans = math.ceil(div)
	print(ans)


T = int(input())
for i in range(T):
	(N, X) = map(int, input().split())
	print(-(-(N * X) // 4))


import math
for i in range(int(input())):
	l1 = [int(x) for x in input().split()]
	print(math.ceil(l1[0] * l1[1] / 4))


t = int(input())
for _ in range(t):
	(n, x) = map(int, input().split())
	d = n * x
	if d % 4 == 0:
		print(d // 4)
	elif d % 4 != 0:
		print(d // 4 + 1)


import math
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	print(math.ceil(x * y / 4))


import math
for i in range(int(input())):
	(n, x) = map(int, input().split())
	c = n * x / 4
	print(math.ceil(c))


import math
t = int(input())
for i in range(t):
	(N, X) = list(map(int, input().split()))
	a = N * X / 4
	print(math.ceil(a))


T = int(input())
for t in range(T):
	(N, X) = map(int, input().split())
	Y = (N * X + 3) // 4
	print(round(Y))


t = int(input())
for i in range(t):
	(n, x) = map(int, input().split())
	ans = n * x // 4
	if ans != n * x / 4:
		print(ans + 1)
	else:
		print(ans)


import math
t = int(input())
while t > 0:
	(n, x) = map(int, input().split())
	print(math.ceil(n * x / 4))
	t -= 1


import math as m
t = int(input())
for i in range(t):
	(n, x) = map(int, input().split())
	if n * x <= 4:
		print(1)
	else:
		print(m.ceil(n * x / 4))


import math
for t in range(int(input())):
	(n, x) = map(int, input().split())
	required_slices = n * x
	print(math.ceil(required_slices / 4))


t = int(input())
for i in range(t):
	l = [int(z) for z in input().split()]
	(a, b) = (l[0], l[1])
	if a * b % 4 == 0:
		print(a * b // 4)
	else:
		print(a * b // 4 + 1)


def run():
	t = int(input())
	for i in range(t):
		(n, x) = map(int, input().split())
		num_pizzas = n * x // 4
		if n * x % 4 != 0:
			num_pizzas += 1
		print(num_pizzas)
run()


import math
t = int(input())
for i in range(t):
	(n, x) = map(int, input().split())
	slices_required = n * x
	pizzas_required = math.ceil(slices_required / 4)
	print(pizzas_required)


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	if x * y % 4 == 0:
		print(int(x * y) // 4)
	else:
		print(int(x * y) // 4 + 1)


T = int(input())
for _ in range(T):
	(n, x) = map(int, input().split())
	a = n * x
	if a % 4 == 0:
		print(a // 4)
	else:
		print(a // 4 + 1)


import math
t = int(input())
while t:
	(n, x) = map(int, input().split())
	slc = n * x
	if slc % 4 != 0:
		print(int(math.floor(slc / 4 + 1)))
	else:
		print(int(slc / 4))
	t -= 1


t = int(input())
for i in range(t):
	(N, X) = list(map(int, input().split()))
	total_slices = N * X
	pizzas = total_slices // 4
	if total_slices % 4 != 0:
		pizzas += 1
	print(pizzas)


import math
for i in range(int(input())):
	(x, y) = map(int, input().split())
	slices = x * y
	pizza = slices / 4
	print(math.ceil(pizza))


import math
t = int(input())
for i in range(t):
	(n, x) = map(int, input().split())
	slices_needed = n * x
	pizzas_needed = math.ceil(slices_needed / 4)
	print(pizzas_needed)


import math
for i in range(int(input())):
	(n, x) = map(int, input().split())
	if n * x % 4 == 0:
		print(n * x // 4)
	elif n * x < 4:
		print(1)
	else:
		print(n * x // 4 + 1)