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, x = 0, y = 0;
  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. for (int i = 0; i <= k; ++i){
  19. if(i%4 == 0){
  20. x += 1 + n*i;
  21. y += 1 + n*i;
  22. } else if (i%4 == 1){
  23. x += 1 + n*i;
  24. y -= 1 + n*i;
  25. } else if(i%4 == 2){
  26. x -= 1 + n*i;
  27. y -= 1 + n*i;
  28. } else if(i%4 == 3){
  29. x -= 1 + n*i;
  30. y += 1 + n*i;
  31. }
  32. }
  33. if(t * t * v * v * 2 >= (x - hx) * (x - hx) + (y - hy) * (y - hy)){
  34. System.out.print("Good night Ia");
  35. } else {
  36. System.out.print("Poor Ia");
  37. }
  38. }
  39. }
Success #stdin #stdout 0.06s 2184192KB
stdin
5 2 3 9
15 15
stdout
Good night Ia