fork(2) download
  1. import java.util.*;
  2. import java.io.*;
  3.  
  4. class atm
  5. {
  6.  
  7. public static void main(String[] args) throws java.lang.Exception
  8. {
  9. double w,c;
  10. Scanner input=new Scanner(System.in);
  11. w=input.nextDouble();
  12. c=input.nextDouble();
  13. double ans = 0.0;
  14. if ( w%5==0 && c>=(w+0.5) )
  15. c = c - w - 0.5;
  16. //else if(w%5==0 && w>=c)
  17. // ans = c;
  18. //else if(w%5!=0 || w>=c)
  19. // ans = c;
  20.  
  21. System.out.printf("%.2f",c);
  22.  
  23. }
  24. }
Success #stdin #stdout 0.16s 321088KB
stdin
42 120.00
stdout
120.00