You are viewing a single comment's thread. Return to all comments →
Congratulations, here is one more solution in Java a little more clean...
public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for (int i = 0; i < n; i++) { int px = sc.nextInt(), py = sc.nextInt(), qx = sc.nextInt(), qy = sc.nextInt(), pe = 2*qx - px, pe2 = 2*qy - py; System.out.println(pe + " " +pe2); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Find the Point
You are viewing a single comment's thread. Return to all comments →
Congratulations, here is one more solution in Java a little more clean...
public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for (int i = 0; i < n; i++) { int px = sc.nextInt(), py = sc.nextInt(), qx = sc.nextInt(), qy = sc.nextInt(), pe = 2*qx - px, pe2 = 2*qy - py; System.out.println(pe + " " +pe2); }
}