Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <algorithm>
- using namespace std;
- int main () {
- freopen("chess.in", "r", stdin);
- freopen("chess.out", "w", stdout);
- int a, b, c, d;
- scanf("%d %d %d %d", &a, &b, &c, &d);
- int dx = abs(a - c), dy = (d - b);
- if ( (dx == 1 && dy == 2) || (dx == 2 && dy == 1) || dx == dy || dx == 0 || dy == 0 )
- puts("YES");
- else
- puts("NO");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement