fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int X1, Y1, X2, Y2;
  6. cin >> X1 >> Y1 >> X2 >> Y2;
  7. if(X1 - 1 == X2 and Y1 + 1 == Y2 or X1 == X2 and Y1 + 1 == Y2){
  8. cout << "YES";
  9. }else if(X2 < 1 or X2 > 8 or Y2 < 1 or Y2 > 8){
  10. cout << "NO";
  11. }
  12. return 0;
  13. }
Success #stdin #stdout 0.01s 5320KB
stdin
3 3 
5 3
stdout
Standard output is empty