414. Orthogonal Circles
Time limit per test: 0.5
Memory limit: 262144
Two circles are orthogonal
, if they intersect and for any point of intersection their tangent lines at that point are perpendicular.
Consider a set of n
circles on the plane. You are to find a circle orthogonal to all of them.
The input file contains an integer n
(1 ≤ n
), followed by n
triples of integers: xi
, denoting the center coordinates and the radii of the circles (-106
, 1 ≤ ri
The circles may coincide.
If there exists exactly one circle orthogonal to all the given ones, output its center coordinates and radius as real numbers separated with single spaces. The numbers will be considered correct if they are within 10-6
relative or absolute error of the exact answers.
In case there's no such circle, output -1. In case there are many, output -2.
0 0 5
7 16 10
10 0 5
5.0 5.0 5.0
The example is illustrated by the following picture: