Chef has N laddus of K sweetness each. Chef wants to eat all laddus, but Chef is restricted with the given condition that he must not eat two adjacent laddus. Chef starts calculating the maximum sweetness that he will get from the laddus. Find the maximum sweetness that chef gets at the end of all calculations. 

-----Input:-----
- First-line will contain $T$, the number of test cases. Then the test cases follow. 
- Each test case contains a single line of input, two integers $N, K$. 

-----Output:-----
For each test case, output in a single line answer as Maximum sweetness the chef will have.

-----Constraints-----
- $1 \leq T \leq 10^5$
- $1 \leq N \leq 10^5$
- $1 \leq K \leq 10^5$

-----Sample Input:-----
2
1 2
4 3

-----Sample Output:-----
2
6

-----EXPLANATION:-----
For 1) Chef will get only 1 laddu with sweetness 2.
For 2) Chef will have multiple ways as
[1,3], [2,4], [1,4] with sweetness 6
[1],[2],[3],[4] with sweetness 3.
Maximum sweetness will be 6.

Source: codechef | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	if n == 1:
		print(m)
	elif n % 2 == 0:
		print(n // 2 * m)
	else:
		print((n // 2 + 1) * m)


for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	if n == 1:
		print(k)
	else:
		if n % 2 == 0:
			p = n // 2
		else:
			p = n // 2 + 1
		ans = p * k
		print(ans)


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


testcases = int(input())
for i in range(testcases):
	(x, y) = [int(y) for y in input().split()]
	if x % 2 == 0:
		print(x // 2 * y)
	else:
		print((x // 2 + 1) * y)


for i in range(int(input())):
	(n, k) = list(map(int, input().split()))
	d = n // 2
	if n % 2 == 1:
		d += 1
	print(d * k)


def Solve2():
	(n, m) = map(int, input().split())
	if n % 2 == 1:
		print((n // 2 + 1) * m)
	else:
		print(n // 2 * m)
for _ in range(int(input())):
	Solve2()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().strip().split())
	if n % 2 != 0:
		print((n + 1) // 2 * k)
	else:
		print(n // 2 * k)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	print(int((n + 1) / 2) * k)


for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	if n % 2:
		s = k * (n // 2 + 1)
	else:
		s = k * (n // 2)
	print(s)


import math
t = int(input())
while t:
	(n1, k1) = input().split(' ')
	n = int(n1)
	k = int(k1)
	val = math.ceil(n / 2)
	res = val * k
	print(res)
	t = t - 1


import math
t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	n = math.ceil(n / 2)
	print(n * k)


try:
	for _ in range(int(input())):
		(n, k) = map(int, input().split())
		if n % 2 == 1:
			print((n // 2 + 1) * k)
		else:
			print(n // 2 * k)
except:
	pass


try:
	from math import ceil
	t = int(input())
	for _ in range(t):
		(n, k) = map(int, input().split())
		print(ceil(n / 2) * k)
except EOFError:
	pass


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


for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	print(k * ((n + 1) // 2))


for _ in range(int(input())):
	(n, k) = [int(x) for x in input().split()]
	if n % 2 == 0:
		print(n // 2 * k)
	else:
		print((n // 2 + 1) * k)


T = int(input())
for i in range(T):
	(N, K) = [int(i) for i in input().split()]
	if N % 2 == 0:
		print(N // 2 * K)
	else:
		print((N // 2 + 1) * K)


t = int(input())
while t:
	t -= 1
	(n, k) = list(map(int, input().split()))
	if n % 2 == 0:
		print(n // 2 * k)
	else:
		print((n // 2 + 1) * k)


for _ in range(int(input())):
	(n, k) = [int(x) for x in input().split()]
	answer = k * (n // 2 + n % 2)
	print(answer)