fork(1) download
  1. import java.io.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStreamReader;
  4.  
  5. class atm {
  6.  
  7. public static void main(String[] args) throws Exception {
  8. String[] inp=br.readLine().split(" ");;
  9. double x=Double.parseDouble(inp[0]);
  10. double y=Double.parseDouble(inp[1]);
  11.  
  12. if((x<y+0.5)&&(x%5==0))
  13. y=y-x-0.5;
  14.  
  15. System.out.printf("%.2f\n",y);
  16. }
  17. }
  18.  
Success #stdin #stdout 0.03s 245632KB
stdin
42 120.00
stdout
120.00