当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3878:X Property

题目描述
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?
输入解释
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.
输出解释
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.
输入样例
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
输出样例
1.000000 1.333333 1.333333
-2
-1
来自杭电HDUOJ的附加信息
Recommend lcy

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3878

最后修改于 2020-10-25T23:07:50+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
5000/2000MS(Java/Others) 65536/32768K(Java/Others)