Problem I
Tricky Triangulation
Amy is trying to find a stronghold by using Eyes of Ender. When thrown, Eyes of Ender fly in the direction of the closest stronghold. However, since Eyes of Ender have a chance of breaking when thrown, Amy wants to limit the number of throws she makes. So, she attempts to locate the stronghold by only using 2 throws.
In Minecraft, locations are represented by block
coordinates,
Given these coordinates, write a program to determine if there is a unique stronghold location determined by the two throws, and if so, what the coordinates of the stronghold are.
Input
The only line of input contains the integers
Output
If there is exactly one possible location for a stronghold
based on the two throws, print the block coordinates
Sample Input 1 | Sample Output 1 |
---|---|
395 -188 420 -150 395 921 400 850 |
465 -81 |
Sample Input 2 | Sample Output 2 |
---|---|
395 -188 420 -150 400 850 395 921 |
-1 |
Sample Input 3 | Sample Output 3 |
---|---|
395 -188 420 -150 395 -188 420 -150 |
-1 |