fork download
  1. import java.util.*;
  2. import java.math.*;
  3.  
  4. class Main
  5. {
  6. public static void main (String[] args)
  7. {
  8. Scanner in = new Scanner(System.in);
  9. double f = (Math.sqrt(5)+1)/2;
  10. double d = in.nextDouble();
  11. double b = d / Math.sqrt(1 + f * f);
  12. double a = b * f;
  13. System.out.print(a + " " + b);
  14. }
  15. }
Success #stdin #stdout 0.08s 4386816KB
stdin
1
stdout
0.85065080835204 0.5257311121191336