Mesley is trying to find his location! He is somewhere at an integer location on the 2-D plane, but he does not know where. He knows the location of distinct, non-collinear satellites, with the satellite at location and his distance squared to them. Can you help him find his location ?
Constraints
For this problem, you will be required to pass all the samples in order to receive any points. In addition, you must pass all previous subtasks to earn points for a specific subtask.
None of the three satellites or Mesley's locations are collinear.
Subtask 1 [14%]
Subtask 2 [16%]
Subtask 3 [70%]
No additional constraints.
Input Specification
The input consists of lines. Each line contains integers, , , , indicating the location of the satellite and Mesley's distance squared to that satellite.
Output Specification
This problem is graded with an identical
checker. This includes whitespace characters. Ensure that every line of output is terminated with a \n
character and that there are no trailing spaces.
Output two space-separated integers representing Mesley's location.
Sample Input
1 1 1
2 1 2
3 5 13
Sample Output
1 2
Comments