F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

X Property

Time Limit: 5000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 193    Accepted Submission(s): 2


Problem Description
The X property is a property of two intersected circles. Suppose we have two intersected circls P and Q, and they intersect at A and B. If the two circles satisfy:

AP*BQ+AQ*BP=AB*PQ

we call these two circles satisfy the X property.

Given N circles on a plane, can you find a circle which has X property with all the N given circles?
 

Input
The first line comes an integer T (T<=20), indicating there are T test cases. For each case, there will be an integer N (1<=N<=100000) in the first line. Then comes N lines. Each of them contains three integer numbers Xi, Yi, Ri (-1000000<=Xi, Yi<=1000000, 0<Ri<=1000000) representing the center of the ith circle and the radius of it.
 

Output
For each case print one line. If there is exactly one such circle, 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.

If there is no such circles, print -1. If there are more than one such circles, print -2.
 

Sample Input
3 3 0 0 1 2 0 1 1 3 1 2 0 0 1 1 1 2 3 0 1 1 0 -1 1 -1 0 1
 

Sample Output
1.000000 1.333333 1.333333 -2 -1
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-05 12:03:17, Gzip enabled