Timer is Running

Missing Point of a Parallelogram
Submissions: 185   Accuracy:


  Difficulty: Easy   Marks: 2

Given three coordinate points A, B and C, find the missing point D such that ABCD can be a parallelogram. There can be multiple such points, so print the lexicographically least coordinate.

The first line of input contains an integer T denoting the number of test cases. Each test case contains three lines for each of the point A, B and C with each line containing space separated integers Xi and Yi as coordinates for each of them.

Print two space separated coordinates of the required point with a precision of 6 decimal places.

1 <= T <= 100
1 <= x,y <= 1000 where x and y denote coordinates of points.


1 1
1 0
0 1
3 2
3 4
2 2
0.000000 0.000000
2.000000 0.000000

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Shashwat Jain
Author: shashwat jain

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.