fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. long int n, k, t, v, hx, hy;
  7. cin >> n >> k >> t >> v >> hx >> hy;
  8. long int s1, s2, s3, s4;
  9. long int m1, m2, m3, m4;
  10. m1 = ((k + 1) % 4 >= 1) ? (k + 1) / 4 + 1 : (k + 1) / 4;
  11. m2 = ((k + 1) % 4 >= 2) ? (k + 1) / 4 + 1 : (k + 1) / 4;
  12. m3 = ((k + 1) % 4 >= 3) ? (k + 1) / 4 + 1 : (k + 1) / 4;
  13. m4 = (k + 1) / 4;
  14. s1 = (1 + (m1 - 1) * 2 * n) * m1;
  15. s2 = (1 + n + 2 * n * (m2 - 1)) * m2;
  16. s3 = (1 + 2 * n + 2 * n * (m3 - 1)) * m3;
  17. s4 = (1 + 3 * n + 2 * n * (m4 - 1)) * m4;
  18. long int x = s1 + s2 - s3 - s4, y = s1 - s2 - s3 + s4;
  19. if (t * t * v * v * 2 >= (x - hx) * (x - hx) + (y - hy) * (y - hy)){
  20. cout << "Good night Ia";
  21. }
  22. else{
  23. cout << "Poor Ia";
  24. }
  25. return 0;
  26. }
Success #stdin #stdout 0s 4212KB
stdin
1 2 3 4
3 0
stdout
Good night Ia