Mario's bullet moves at X pixels per frame. He wishes to shoot a goomba standing Y pixels away from him. The goomba does not move.
 
Find the minimum time (in seconds) after which Mario should shoot the bullet, such that it hits the goomba after at least Z seconds from now.

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

- The first line of input will contain an integer T, the number of test cases. Then the test cases follow.
- Each test case consists of a single line of input, containing three space-separated integers X, Y, and Z.

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

For each test case, output in a single line the minimum time (in seconds) after which Mario should shoot the bullet, such that it hits the goomba after at least Z seconds from now.

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

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

----- Sample Input 1 ------ 
3
3 3 5
2 4 1
3 12 8
----- Sample Output 1 ------ 
4
0
4
----- explanation 1 ------ 
Test case $1$: The speed of the bullet is $3$ pixels per frame and the goomba is $3$ pixels away from Mario. Thus, it would take $1$ second for the bullet to reach the goomba. Mario wants the bullet to reach goomba after at least $5$ seconds. So, he should fire the bullet after $4$ seconds.

Test case $2$: The speed of the bullet is $2$ pixels per frame and the goomba is $4$ pixels away from Mario. Thus, it would take $2$ seconds for the bullet to reach the goomba. Mario wants the bullet to reach the goomba after at least $1$ second. So, he should fire the bullet after $0$ seconds. Note that, this is the minimum time after which he can shoot a bullet.

Test case $3$: The speed of the bullet is $3$ pixels per frame and the goomba is $12$ pixels away from Mario. Thus, it would take $4$ seconds for the bullet to reach the goomba. Mario wants the bullet to reach goomba after at least $8$ seconds. So, he should fire the bullet after $4$ seconds.

Difficulty: EASY
Tags: Mathematics

Starter code:

Solutions:
T = int(input(''))
for i in range(0, T):
	(x, y, z) = list(map(int, input().strip().split()))
	if y % x == 0:
		temp = int(y / x)
		if z > temp:
			print(z - temp)
		else:
			print('0')
	else:
		break


T = int(input())
for i in range(T):
	(X, Y, Z) = map(int, input().split())
	Result = int(Y / X)
	if Result > Z:
		print('0')
	else:
		print(Z - Result)


t = int(input())
for i in range(t):
	(x, y, z) = list(map(int, input().split()))
	val1 = y / x
	ans = int(z - val1)
	print(max(0, ans))


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


T = int(input())
for i in range(0, T):
	(x, y, z) = input().split()
	x = int(x)
	y = int(y)
	z = int(z)
	if x in range(1, 101) and y in range(1, 101) and (z in range(1, 101)):
		if y % x == 0:
			ti = y // x
			if ti >= z:
				print('0')
			else:
				te = z - ti
				print(te)


for i in range(int(input())):
	(x, y, z) = map(int, input().split())
	bt = y // x
	ans = z - bt
	if ans < 0:
		ans = 0
	print(ans)


for _ in range(int(input())):
	(x, y, z) = map(int, input().split())
	res = z - y // x
	if res < 0:
		print(0)
	else:
		print(res)


for _ in range(int(input())):
	(X, Y, Z) = map(int, input().split())
	if Z - Y // X > -1:
		print(Z - Y // X)
	else:
		print(0)


t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split(' '))
	d = b // a
	if d > c:
		print(0)
	else:
		print(c - d)


n = int(input())
for i in range(n):
	c = 0
	m = input().split()
	k = int(m[1]) // int(m[0])
	if k > int(m[2]):
		c = 0
		print(c)
	else:
		while k != int(m[2]):
			k += 1
			c += 1
		print(c)


for _ in range(int(input())):
	(x, y, z) = map(int, input().split())
	s = int(y / x)
	t = z - s
	if t < 0:
		print(0)
	else:
		print(t)


a = int(input())
for i in range(a):
	(b, c, d) = map(int, input().split())
	e = c // b
	f = d - e
	if f < 0:
		print('0')
	else:
		print(f)


T = int(input())
for i in range(0, T):
	(x, y, z) = map(int, input().split())
	temp = y // x
	temp2 = z - temp
	if z - temp >= 0:
		print(z - temp)
	else:
		print(0)


t = int(input())
for i in range(t):
	(X, Y, Z) = map(int, input().split())
	time = Y // X
	if time > Z:
		print('0')
	else:
		print(Z - time)


for i in range(int(input())):
	(x, y, z) = map(int, input().split())
	bullet = y // x
	if bullet <= z:
		print(abs(z - bullet))
	else:
		print(0)


def main():
	t = int(input())
	for i in range(t):
		(speed, dis, time) = map(int, input().split())
		sec = dis // speed
		if sec >= time:
			print(0)
		else:
			final = sec - time
			if final < 0:
				print(-final)
			else:
				print(final)
main()


T = int(input())
for i in range(T):
	(x, y, z) = map(int, input().split())
	a = y // x
	b = z - a
	if b < 0:
		print(0)
	else:
		print(b)


for i in range(int(input())):
	(x, y, z) = map(int, input().split())
	q = y // x
	a = z - q
	if a < 0:
		print(0)
	else:
		print(a)


testcase = int(input())
while testcase > 0:
	(x, y, z) = map(int, input().split())
	time_to_reach = y // x
	min_time = z - time_to_reach
	if time_to_reach < z:
		print(min_time)
	else:
		print(0)
	testcase -= 1


def bullet(t):
	for _ in range(t):
		(mario, goomba, sec) = map(int, input().split())
		mg_away_sec = goomba // mario
		time = sec - mg_away_sec
		res = time if time > 0 else 0
		print(res)
bullet(int(input()))


t = int(input())
for i in range(t):
	(x, y, z) = map(int, input().split())
	b = y / x
	a = z - y // x
	if a < 0:
		a = 0
	print(a)


T = int(input())
for tc in range(T):
	(X, Y, Z) = map(int, input().split(' '))
	t = Z - int(Y / X)
	if t >= 0:
		print(int(t))
	else:
		print('0')


T = int(input())
for z in range(T):
	H = input().split()
	X = int(H[0])
	Y = int(H[1])
	Z = int(H[2])
	A = int(Y / X)
	B = int(Z - A)
	if B < 0:
		B = 0
	print(B)


n = int(input())
for i in range(n):
	(x, y, z) = list(map(int, input().split()))
	a = y // x
	if z - a > 0:
		print(z - a)
	else:
		print('0')


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


t = int(input())
for _ in range(t):
	(x, y, z) = map(int, input().split(' '))
	time = y // x
	print(max(z - time, 0))


n = int(input())
for i in range(0, n):
	(a, b, c) = map(int, input().split())
	k = b // a
	if c - k > 0:
		print(c - k)
	else:
		print(0)


t = int(input())
for _ in range(t):
	(bullet_speed, target_dist, hit_after) = map(int, input().split())
	time_to_target = target_dist // bullet_speed
	print(max(hit_after - time_to_target, 0))


for i in range(int(input())):
	(x, y, z) = map(int, input().split())
	time = y // x
	ans = z - time
	if time > z:
		print('0')
	else:
		print(ans)


for t in range(int(input())):
	(x, y, z) = map(int, input().split())
	c = y // x
	res = z - c
	if res < 0:
		res = 0
	print(res)


t = int(input())
for _ in range(t):
	(x, y, z) = map(int, input().split())
	bt = y // x
	ans = z - bt
	if ans < 0:
		ans = 0
	print(ans)