fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const int r1 = 3;
  5. const int r2 = 5;
  6.  
  7. int main() {
  8. double x, y;
  9. cin >> x >> y;
  10. cout << (x > 0 && ((x + 0.5) * (x + 0.5) + y * y >= r1 * r1) && (x * x + y * y <= r2 * r2) ? "YES" : "NO");
  11. return 0;
  12. }
Success #stdin #stdout 0s 3460KB
stdin
2 -2
stdout
YES