jakaria_hossain

codeforce - pashmak and garden

Jun 16th, 2019
93
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3. int abs(int x)
  4. {
  5. return (x > 0 ? x : -x);
  6. }
  7. int main()
  8. {
  9. ios::sync_with_stdio(false);
  10. int x1, y1, x2, y2;
  11. cin >> x1 >> y1 >> x2 >> y2;
  12. if (x1 != x2 && y1 != y2 && abs(x1 - x2) != abs(y1 - y2))
  13. cout << -1 << endl;
  14. else if (x1 == x2)
  15. cout << x1 + abs(y1 - y2) << " " << y1 << " " << x2 + abs(y1 - y2) << " " << y2 << endl;
  16. else if (y1 == y2)
  17. cout << x1 << " " << y1 + abs(x1 - x2) << " " << x2 << " " << y2 + abs(x1 - x2) << endl;
  18. else
  19. cout << x1 << " " << y2 << " " << x2 << " " << y1 << endl;
  20. return 0;
  21. }
RAW Paste Data