Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //goo.gl/LJFweF
- #include <iostream>
- #include <cmath>
- using namespace std;
- bool IsPointInArea(int x, int y) {
- 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)));
- }
- int main() {
- int x, y;
- cin >> x >> y;
- IsPointInArea(x, y) ? cout << "YES" : cout << "NO";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement