Advertisement
Malinovsky239

Untitled

Nov 23rd, 2011
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <cstdio>
  2. #include <algorithm>
  3. using namespace std;
  4. int main () {
  5.     freopen("chess.in", "r", stdin);
  6.     freopen("chess.out", "w", stdout);
  7.     int a, b, c, d;
  8.     scanf("%d %d %d %d", &a, &b, &c, &d);
  9.     int dx = abs(a - c), dy = (d - b);
  10.     if ( (dx == 1 && dy == 2) || (dx == 2 && dy == 1) || dx == dy || dx == 0 || dy == 0 )
  11.             puts("YES");
  12.         else
  13.             puts("NO");
  14.  
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement