Chef recently realized that he needs a haircut, and went to his favorite hair salon. At the salon, he found N customers waiting for their haircuts. From his past experience, Chef knows that the salon takes M minutes per customer. Only one person can get their haircut at a time.

For how many minutes will Chef have to wait before he can get his haircut?

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

- The first line of input contains a single integer T, denoting the number of test cases. The description of T test cases follows.
- The first and only line of each test case contains two space-separated integers N and M, as described in the problem. 

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

For each test case, print a single line containing one integer — the number of minutes that Chef will have to wait before he can get his haircut.

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

$1 ≤ T ≤ 1000$
$0 ≤ N ≤ 1000$
$1 ≤ M ≤ 1000$

------ subtasks ------ 

Subtask #1 (100 points): Original constraints

----- Sample Input 1 ------ 
2
2 15
0 15

----- Sample Output 1 ------ 
30
0

----- explanation 1 ------ 
Test case $1$: There are $2$ customers waiting for the haircut and the salon will take $15$ minutes for each customer, hence Chef will have to wait for $30$ minutes before he can get his haircut.

Test case $2$: There are $0$ customers waiting for the haircut, therefore the Chef will not have wait to get the haircut.

Difficulty: EASY
Tags: Mathematics

Starter code:

Solutions:
T = int(input())
for i in range(T):
	(n, m) = map(int, input().split())
	if n > 0:
		t = n * m
	else:
		t = 0
	print(t)


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


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	print(m * n)


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


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


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


T = int(input())
for _ in range(T):
	(A, B) = map(int, input().split())
	print(A * B)


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


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


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


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


def code():
	cases = int(input())
	for _ in range(cases):
		(N, M) = map(int, input().split(' '))
		print(N * M)
code()


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


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


t = int(input())
while t:
	t -= 1
	(n, m) = map(int, input().split())
	print(n * m)


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


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


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


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


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


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


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


try:
	t = int(input())
	for r in range(t):
		(n, m) = map(int, input().split())
		print(n * m)
except:
	pass


for i in range(int(input())):
	(custom, each) = map(int, input().split())
	print(custom * each)


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


for case in range(int(input())):
	cal_list = list(map(int, input().split()))
	print(cal_list[0] * cal_list[-1])


goals = int(input())
for distractions in range(goals):
	(life, wife) = map(int, input().split())
	print(life * wife)


for t in range(int(input())):
	(members, minutes) = map(int, input().split())
	print(members * minutes)