编程介的小学生 2017-10-29 09:29 采纳率: 20.3%
浏览 710
已采纳

X Property

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

  • 写回答

2条回答 默认 最新

  • threenewbee 2017-11-18 15:42
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 在获取boss直聘的聊天的时候只能获取到前40条聊天数据
  • ¥20 关于URL获取的参数,无法执行二选一查询
  • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
  • ¥15 marlin编译错误,如何解决?
  • ¥15 有偿四位数,节约算法和扫描算法
  • ¥15 VUE项目怎么运行,系统打不开
  • ¥50 pointpillars等目标检测算法怎么融合注意力机制
  • ¥20 Vs code Mac系统 PHP Debug调试环境配置
  • ¥60 大一项目课,微信小程序
  • ¥15 求视频摘要youtube和ovp数据集