program saying wrong

this code for atm problem(http://www.codechef.com/problems/HS08TEST) is giving wrong answer help!!!
import java.util.*;
class atm
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
double sal=sc.nextDouble();
if(n%5==0&&sal>=n)
{
sal=sal-n-0.5;
System.out.println(sal);
}
else
System.out.println(sal);
}
}

provide an ideone link of your solution…