Why My solution is wrong for Problem ATM

CodeChef: Practical coding for everyone its link to my code
whats wrong in it.

the condition for "if(x<y)"in this you should check for “if(x+0.5<y)” as after subtracting 0.5 extra from balance both become equal.

Instead of

if X%5==0:

in line 6. you should type

if X%5 == 0 or X+0.5 > Y:

and there will be no need of Lines 5,11,12 which makes you code much better.

X,Y = input().split()
X = int(X)
Y = float(Y)
if (X>=1 and X<=2000)and(Y>=1 and Y<=2000):
	if X%5==0 or X+0.5 > Y:
		Y = Y-X-0.5
		print("%.2f" %Y)
	else:
		print("%.2f" %Y)