My issue
Using loop for trial sessions count, is a crude method.
I propose following method:
for _ in range(int(input())):
D, X, Y = map(int, input().split())
k = ceil((Y - X)/(1 - XD/100)) if XD > 100 else 0
if Y >= X:
print(0)
elif 0 < k < Y:
print(k)
else:
print(-1)
However, the method fails on a case. Can somebody figure out the bug?
My code
# cook your dish here
from math import ceil, floor
for _ in range(int(input())):
D, X, Y = map(int, input().split())
k = ceil((Y - X)/(1 - X*D/100)) if X*D > 100 else 0
if Y >= X:
print(0)
elif 0 < k < Y:
print(k)
else:
print(-1)
Problem Link: International Gym Day Practice Coding Problem