fork download
  1. import java.util.*;
  2. import java.text.*;
  3. import java.io.*;
  4. class FLOW011
  5. {
  6. public static void main (String[] args)
  7. {
  8. Scanner s = new Scanner(System.in);
  9. int n= s.nextInt();
  10. DecimalFormat df = new DecimalFormat("###.#");
  11. for(int i=0; i<n; i++){
  12. int b;
  13. float h,d,gs;
  14. b = s.nextInt();
  15. if(b<1500)
  16. {
  17. gs = 2*b;
  18. }
  19. else
  20. {
  21. gs = (float) 1.98*b + 500;
  22. }
  23. System.out.println(df.format(gs));
  24. }
  25. }
  26. }
Success #stdin #stdout 0.06s 4386816KB
stdin
3 
1203
10042
1312
stdout
2406
20383.2
2624