fork(2) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. double a, b, c,f, p = 1.5;
  13. Scanner x = new Scanner(System.in);
  14. a=x.nextDouble();
  15. c = a/p;
  16. b = Math.floor(a/p);
  17. a = (c-b)*p;
  18. f = a*a*a-2.25*a;
  19. System.out.print(f);
  20. }
  21. }
Success #stdin #stdout 0.15s 321344KB
stdin
3.7
stdout
-1.2320000000000002