import java.io.*;
public class ATM{
public static void main(String args[]){
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
float bankCharges = 0.50f;
String values=null;
try{
values = br.readLine();
String [] split = values.split(" ");
float withdraw = Float.parseFloat(split[0]);
float amount = Float.parseFloat(split[1]);
if(withdraw>amount)
System.out.println(amount);
else if (withdraw+bankCharges<=amount)
{
if(withdraw % 5 == 0){
amount=amount-(withdraw+bankCharges);
System.out.println(amount);
}
else System.out.println(amount);
}
}
catch(Exception e){
}
}
}
Worng Answer is shown while submitting the code. To make the answer in the correct format , I’ve tried adding “0” in the “System.out.println”, as the output was in the string format.