fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4. import java.math.*;
  5.  
  6. class Coordinates{
  7. public static void main (String[] args) throws java.lang.Exception {
  8. Scanner read = new Scanner(System.in);
  9. double x = read.nextDouble();
  10. double y = read.nextDouble();
  11. double u;
  12. if((y >= x*x) && (y <= Math.exp(-x)) && (y <= Math.exp(x)))
  13. u = x+y;
  14. else
  15. u = x-y;
  16. System.out.print(u);
  17. }
  18. }
Success #stdin #stdout 0.17s 321344KB
stdin
0 1
stdout
1.0