Wesley's Anger Contest Reject 4 - GPS

View as PDF

Submit solution


Points: 10 (partial)
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type

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 3 distinct, non-collinear satellites, with the ith satellite at location (xi,yi) and his distance squared di2 to them. Can you help him find his location (xt,yt)?

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.

1xi,yi1000000000
1xt,yt1000000000
None of the three satellites or Mesley's locations are collinear.

Subtask 1 [14%]

1xi,yi1000
1xt,yt1000

Subtask 2 [16%]

1xi,yi1000000
1xt,yt1000000

Subtask 3 [70%]

No additional constraints.

Input Specification

The input consists of 3 lines. Each line contains 3 integers, xi, yi, di2, indicating the location of the ith 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 (xt,yt) representing Mesley's location.

Sample Input

Copy
1 1 1
2 1 2
3 5 13

Sample Output

Copy
1 2

Comments

There are no comments at the moment.