fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. int x1, y1, x2, y2;
  7. cin >> x1 >> y1 >> x2 >> y2;
  8. // слон
  9. bool s = (x1 - x2) * (x1 - x2) == (y1 - y2) * (y1 - y2);
  10. // ладья
  11. bool l = x1 == x2 || y1 == y2;
  12. cout << (s || l ? "YES" : "NO");
  13. return 0;
  14. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
NO