fork download
  1. import java.io.BufferedReader;
  2. import java.io.InputStreamReader;
  3.  
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
  9. String[] params1 = bufferedReader.readLine().split(" ");
  10. String[] params2 = bufferedReader.readLine().split(" ");
  11. int n, k, t, v, hx, hy;
  12. n = Integer.parseInt(params1[0]);
  13. k = Integer.parseInt(params1[1]);
  14. t = Integer.parseInt(params1[2]);
  15. v = Integer.parseInt(params1[3]);
  16. hx = Integer.parseInt(params2[0]);
  17. hy = Integer.parseInt(params2[1]);
  18. int s1, s2, s3, s4, m1, m2, m3, m4;
  19. m1 = ((k + 1) % 4 >= 1) ? (k + 1) / 4 + 1 : (k + 1) / 4;
  20. m2 = ((k + 1) % 4 >= 2) ? (k + 1) / 4 + 1 : (k + 1) / 4;
  21. m3 = ((k + 1) % 4 >= 3) ? (k + 1) / 4 + 1 : (k + 1) / 4;
  22. m4 = (k + 1) / 4;
  23. s1 = (1 + (m1 - 1) * 2 * n) * m1;
  24. s2 = (1 + n + 2 * n * (m2 - 1)) * m2;
  25. s3 = (1 + 2 * n + 2 * n * (m3 - 1)) * m3;
  26. s4 = (1 + 3 * n + 2 * n * (m4 - 1)) * m4;
  27. int x = s1 + s2 - s3 - s4, y = s1 - s2 - s3 + s4;
  28. if(t * t * v * v * 2 >= (x - hx) * (x - hx) + (y - hy) * (y - hy)){
  29. System.out.print("Good night Ia");
  30. } else {
  31. System.out.print("Poor Ia");
  32. }
  33. }
  34. }
Success #stdin #stdout 0.04s 2184192KB
stdin
1 5 3 2
5 7
stdout
Good night Ia