fork download
  1. import java.util.Scanner;
  2.  
  3. class Main {
  4. public static void main (String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. int x1 = scanner.nextInt();
  7. int y1 = scanner.nextInt();
  8. int x2 = scanner.nextInt();
  9. int y2 = scanner.nextInt();
  10. int x3 = scanner.nextInt();
  11. int y3 = scanner.nextInt();
  12. if ((x2-x1)*(x3-x1)+(y2-y1)*(y3-y1)==0) {
  13. System.out.println((x2+x3-x1)+" "+(y2+y3-y1));
  14. }
  15. else if ((x2-x1)*(x3-x2)+(y2-y1)*(y3-y2)==0) {
  16. System.out.println((x1+x3-x2)+" "+(y1+y3-y2));
  17. }
  18. else if ((x3-x1)*(x3-x2)+(y3-y1)*(y3-y2)==0) {
  19. System.out.println((x1+x2-x3)+" "+(y1+y2-y3));
  20. }
  21. }
  22. }
Success #stdin #stdout 0.06s 2184192KB
stdin
0 0 0 1 2 1
stdout
2 0