fork(2) download
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4.  
  5. const double a = 2;
  6. const double b = 1.5;
  7. const double c = 5;
  8. const double d = 5.5;
  9.  
  10. int main(){
  11. double x, y;
  12. cin >> x >> y;
  13. x -= 0.5;
  14. cout << (fabs(y) > c || fabs(x) > d || (x < -b && y > -a) || (x > b && y < a) ? "NO" : "YES");
  15. return 0;
  16. }
Success #stdin #stdout 0s 3416KB
stdin
-4 -2
stdout
YES