My issue
TEST CASES ARE NOT GETTING PASSED
My code
# cook your dish here
t=int(input())
for i in range(t):
n,m=map(int,input().split())
a=(10/100)*n
b=int(a)
c=n-b
if c<m:
print("ONLINE")
elif c==m:
print("EITHER")
else:
print("DINING")
Problem Link: FOODPLAN Problem - CodeChef
@pavansaiduvvur
for test case
1
1 1
Your code is giving “Either”.
But the answer would be “Online”.
Take the n and m as double for accurate measurement. I also had a similar problem but when I did it with double it worked.
t=int(input())
for i in range(t):
n,m=map(double,input().split())
a=(10.0/100.0)*n
# b=int(a)
c=n-a
if c<m:
print("ONLINE")
elif c==m:
print("EITHER")
else:
print("DINING")
1 Like