x,y=input().split()
y=float(y)
if(x>0andx<=2000)and(y>0andy<=2000)and(float(x)+0.5<=y)and(x%5==0):
y=y-x-0.5
print("%.2f"y)
else:
print(".2f"%y)
You didn’t specified the language but it looks like python. I will answer accordingly. You approach seems right except the part you are taking input. The correct way to do this is:
x, y = map(float,raw_input().split())
Thus, this should give you an AC:
x, y = map(float,raw_input().split())
if(x>0 and x<=2000) and (y>0 and y<=2000) and (float(x)+0.5 <= y) and (x%5==0):
y=y-x-0.5
print("%.2f"%y)
else:
print("%.2f"%y)
This is ur corrected code…http://www.codechef.com/viewsolution/2186366 …
the problem was the way you were taking input…it is rectified in the code…u need to use it in the following way:-
var_1,var_2,var_3,.....,var_n = map(data-type,raw_input().split())
hope this helps…
going by the first answer…it still gives runtime error…please help
for python 3.1.2 use input() instead of raw_input()!!!
Hello,
The problem is “ill-defined” in some languages as it seems to be the case of Python… I remember someone else posted a question regarding this problem.
This code:
http://www.codechef.com/viewsolution/1635296
gets you AC in Python.
Best regards,
Bruno