Everytime I compile it, I get correct answers. But when I submit it here, it says wrong answer. [http://www.codechef.com/viewsolution/1015864 ]
import java.util.Scanner;
class ATM
{
public static void main(String[] args)
{
int wd;
double ab;
Scanner sc=new Scanner(System.in);
wd=sc.nextInt();
ab=sc.nextDouble();
if (wd%5==0 && (ab+0.5)>wd)
{
ab=ab-wd-0.5;
}
System.out.printf("%.2f",ab);
}
}