fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int x1, x2, x3, y1, y2, y3;
  6. cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  7. if ((x2-x1)*(x3-x1)+(y2-y1)*(y3-y1)==0)
  8. {
  9. cout << x2+x3-x1 << " " << y2+y3-y1;
  10. }
  11. else if ((x2-x1)*(x3-x2)+(y2-y1)*(y3-y2)==0)
  12. {
  13. cout << x1+x3-x2 << " " << y1+y3-y2;
  14. }
  15. else if ((x3-x1)*(x3-x2)+(y3-y1)*(y3-y2)==0)
  16. {
  17. cout << x1+x2-x3 << " " << y1+y2-y3;
  18. }
  19. return 0;
  20. }
Success #stdin #stdout 0s 4192KB
stdin
8 0 1 6 0 4
stdout
9 2