Advertisement
TwITe

Stepik_Task_8

Jul 24th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. //goo.gl/LJFweF
  2. #include <iostream>
  3. #include <cmath>
  4. using namespace std;
  5.  
  6. bool IsPointInArea(int x, int y) {
  7.     return (((pow(x - (-1), 2) + pow(y - 1, 2) <= 4) && (x >= -y) && (2 * x + 2 <= y)) || ((pow(x - (-1), 2) + pow(y - 1, 2) >= 4) && (x <= -y) && (2 * x + 2 >= y)));
  8. }
  9.  
  10. int main() {
  11.     int x, y;
  12.     cin >> x >> y;
  13.     IsPointInArea(x, y) ? cout << "YES" : cout << "NO";
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement