Recently Chef joined a new company. In this company, the employees have to work for X hours each day from Monday to Thursday. Also, in this company, Friday is called Chill Day — employees only have to work for Y hours (Y < X) on Friday. Saturdays and Sundays are holidays.

Determine the total number of working hours in one week.

------ 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 space-separated integers X and Y — the number of working hours on each day from Monday to Thursday and the number of working hours on Friday respectively.

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

For each test case, output the total number of working hours in one week.

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

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

----- Sample Input 1 ------ 
3
10 5
12 2
8 7

----- Sample Output 1 ------ 
45
50
39

----- explanation 1 ------ 
Test case $1$: The total number of working hours in a week are: $10 \texttt{(Monday)} + 10 \texttt{(Tuesday)} + 10 \texttt{(Wednesday)} + 10 \texttt{(Thursday)} + 5 \texttt{(Friday)} = 45$

Test Case 2: The total number of working hours in a week are: $12 \texttt{(Monday)} + 12 \texttt{(Tuesday)} + 12 \texttt{(Wednesday)} + 12 \texttt{(Thursday)} + 2 \texttt{(Friday)} = 50$

Test Case 3: The total number of working hours in a week are: $8 \texttt{(Monday)} + 8 \texttt{(Tuesday)} + 8 \texttt{(Wednesday)} + 8 \texttt{(Thursday)} + 7 \texttt{(Friday)} = 39$

Difficulty: EASY

Solutions:
for i in range(int(input())):
	(x, y) = map(int, input().split())
	print(x * 4 + y)


t = int(input())
for i in range(t):
	(x, y) = [int(x) for x in input().split()]
	print(x * 4 + y)


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


T = int(input())
for i in range(T):
	(X, Y) = map(int, input().split())
	total_num_work = X * 4 + Y
	print(total_num_work)


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	print(a * 4 + b)


t = int(input())
while t:
	(x, y) = map(int, input().split())
	print(4 * x + y)
	t -= 1


n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	c = a * 4 + b * 1
	print(c)


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


t = int(input())
for i in range(t):
	(n, m) = map(int, input().split())
	print(n * 4 + m)


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	print(4 * x + y)


t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	working = x * 4
	chill = y
	print(working + chill)


T = int(input())
for i in range(T):
	(a, b) = list(map(int, input().split()))
	c = a * 4 + b
	print(c)


T = int(input())
while T:
	T -= 1
	(X, Y) = map(int, input().split())
	print(X * 4 + Y)


t = int(input(''))
counter = 0
if 1 <= t <= 100:
	while counter < t:
		xandy = input('')
		xandy = xandy.split()
		xandy = [eval(i) for i in xandy]
		x = xandy[0]
		y = xandy[1]
		if 2 <= x <= 12 and 1 <= y < x:
			print(4 * x + y)
			counter += 1


t = int(input())
while t != 0:
	(a, b) = map(int, input().split())
	print(a * 4 + b)
	t = t - 1


T = int(input())
for i in range(T):
	(N, M) = map(int, input().split())
	print(N * 4 + M)


t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	a = x * 4
	b = a + y
	print(b)


t = int(input())
for i in range(t):
	(x, y) = list(map(int, input().split()))
	ans = x * 4 + y
	print(ans)


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


for i in range(0, int(input())):
	n = input().split()
	print(int(n[0]) * 4 + int(n[1]))


T = int(input())
for i in range(T):
	(X, Y) = map(int, input().split())
	X_hours = 4 * X
	Y_hours = Y
	print(X_hours + Y_hours)


t = int(input())
for i in range(t):
	(X, Y) = map(int, input().split())
	new = X * 4
	print(new + Y)


T = int(input())
for i in range(T):
	(X, Y) = map(int, input().split())
	wkds = X * 4
	wknd = Y * 1
	print(wknd + wkds)


for t in range(int(input())):
	(x, y) = map(int, input().split())
	print(x * 4 + y)


T = int(input())
for i in range(0, T):
	(x, y) = map(int, input().split())
	n = x * 4
	f = y * 1
	print(n + f)


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


t = int(input())
for i in range(t):
	(x, y) = list(map(int, input().split()))
	c = x * 4
	d = y * 1
	print(c + d)


d = int(input())
for l in range(d):
	(x, y) = map(int, input().split())
	print(4 * x + y)


t = int(input())
for i in range(t):
	(X, Y) = list(map(int, input().split()))
	a = X * 4 + Y
	print(a)


T = int(input())
for num in range(0, T):
	(x, y) = map(int, input().split())
	a = x * 4
	b = y * 1
	print(a + b)


x = int(input())
for i in range(0, x):
	(p, q) = map(int, input().split())
	y = p * 4
	z = q * 1
	print(y + z)


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


T = int(input())
for tc in range(T):
	(x, y) = map(int, input().split())
	print(x * 4 + y * 1)