Chef has planned that he will drink exactly X liters of tea daily. He has an empty jar having a capacity of Y liters.

Chef can visit the tea shop to refill the jar. In each refill, the jar is completely filled to the brim and Chef is charged Z rupees.

Chef wonders what is the minimum amount of money he has to pay for drinking exactly X liters of tea daily.

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

- First line will contain T, number of test cases. Then the test cases follow.
- Each test case contains of a single line of input, three space-separated integers X, Y, and Z denoting the amount of tea Chef has to drink daily, the capacity of his jar and the cost of refilling his jar.

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

For each test case, output in a single line, the minimum amount Chef has to pay.

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

$1 ≤ T ≤ 1000$
$1 ≤ X, Y, Z ≤ 100$

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

----- Sample Output 1 ------ 
3
6
2
15

----- explanation 1 ------ 
Test case $1$: Chef can get his jar refilled once and drink $3$ liters of tea, which will cost him $3$ rupees in total. 

Test case $2$: Chef needs to refill his jar twice to get $3\cdot 2 = 6$ liters of tea, which will cost him $3\cdot 2 = 6$ rupees in total.

Test case $3$: Chef can refill his jar once and drink exactly $5$ liters out of the $7$ liters. This will cost him $2$ rupees.

Test case $4$: Chef can refill his jar twice and drink $4\cdot 2 = 8$ liters of tea. He needs to have one more refill, but this time he would drink only $1$ liter tea from the jar. Thus the total tea he drinks is $4+4+1 = 9$ liters. He made $3$ refills in total costing him $5\cdot 3 = 15$ rupees.

Difficulty: EASY

Starter code:

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


T = int(input())
while T > 0:
	(X, Y, Z) = input().split()
	k1 = int(X)
	k2 = int(Y)
	k3 = int(Z)
	if k1 > k2:
		jars_count = k1 / k2
		if k1 % k2 != 0:
			remaining = 1
		else:
			remaining = 0
	else:
		jars_count = 1
		remaining = 0
	charge = int(jars_count) * k3 + remaining * k3
	print(int(charge))
	T = T - 1


import math
t = int(input())
for i in range(t):
	(x, y, z) = map(int, input().split())
	if y >= x:
		print(z)
	else:
		print(math.ceil(x / y) * z)


import math
T = int(input())
for i in range(T):
	(X, Y, Z) = map(int, input().split())
	if X % Y == 0:
		print(int(X / Y) * Z)
	else:
		print(math.ceil(X / Y) * Z)


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


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


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


for i in range(int(input())):
	(x, y, z) = map(int, input().split())
	z1 = (x + y - 1) // y
	z2 = z1 * z
	print(z2)


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


import math
t = int(input())
for i in range(t):
	(X, Y, Z) = list(map(int, input().split()))
	if Y >= X:
		print(Z)
	elif Y < X:
		print(math.ceil(X / Y) * Z)


import math
for i in range(int(input())):
	x = list(map(int, input().split()))
	res = x[0] - x[1]
	if x[0] == x[1]:
		print(x[2])
	elif x[0] < x[1]:
		print(x[2])
	else:
		print(math.ceil(x[0] / x[1]) * x[2])


import math
n = int(input())
for j in range(n):
	(a, b, c) = map(int, input().split())
	if a == b:
		print(c)
	elif a < b:
		print(c)
	else:
		print(math.ceil(a / b) * c)


import math
n = int(input())
for i in range(n):
	(x, y, z) = map(int, input().split())
	if x == y:
		print(z)
	elif x > y:
		a = math.ceil(x / y)
		print(a * z)
	else:
		print(z)


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


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


T = int(input())
while T:
	T -= 1
	(X, Y, Z) = map(int, input().split())
	if X <= Y:
		print(Z)
	else:
		i = 2
		while True:
			temp_Y = Y * i
			temp_Z = Z * i
			i += 1
			if X <= temp_Y:
				print(temp_Z)
				break


t = int(input())
for _ in range(t):
	(x, y, z) = map(int, input().split())
	c = 0
	for i in range(0, 100):
		if y * i >= x:
			c = i
			break
	print(i * z)


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


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


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


n = int(input())
for i in range(n):
	(a, b, c) = map(int, input().split())
	s = a // b
	if b >= a:
		print(c)
	elif a % b == 0:
		print(s * c)
	else:
		print((s + 1) * c)


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


for _ in range(int(input())):
	(X, Y, Z) = map(int, input().split())
	fill = 0
	while X > 0:
		fill += 1
		X -= Y
	print(fill * Z)


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


n = int(input())
for i in range(n):
	(a, b, c) = map(int, input().split(' '))
	if a <= b:
		print(c)
	else:
		d = a // b
		e = a % b
		if e > 0:
			print((d + 1) * c)
		else:
			print(d * c)


t = int(input())
while t > 0:
	(x, y, z) = map(int, input().split())
	if x % y == 0:
		print(x // y * z)
	else:
		print((x // y + 1) * z)
	t -= 1


t = int(input())
for _ in range(t):
	(total_amount, jar, cost_per_jar) = map(int, input().split())
	if total_amount % jar == 0:
		print(total_amount // jar * cost_per_jar)
	else:
		print((total_amount // jar + 1) * cost_per_jar)


import math
t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	if b >= a:
		print(c)
	else:
		print(math.ceil(a / b) * c)


t = int(input())
for _ in range(t):
	(x, y, z) = list(map(int, input().split()))
	if x <= y:
		print(z)
	elif x > y:
		if x % y == 0:
			print(x // y * z)
		else:
			res = x // y
			total = res * (z + 1)
			print(x // y * z + z)


T = int(input())
while T > 0:
	(X, Y, Z) = map(int, input().split())
	if X > Y and X % Y != 0:
		print((X // Y + 1) * Z)
	elif X > Y and X % Y == 0:
		print(X // Y * Z)
	elif X <= Y:
		print(Z)
	T = T - 1


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


import math
for _ in range(int(input())):
	(X, Y, Z) = map(int, input().split())
	print(math.ceil(X / Y) * Z)


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


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