3472. Center

单测试点时限: 2.0 秒

内存限制: 256 MB

There are weighted points in a plane. Point is at and has weight .

In this problem, we need to find a special center of these points. The center is a point such that is minimum.

输入

The input starts with one line containing exactly one integer , which is the number of test cases. test cases follow.

Each test case begins with one line containing one integer . lines follow. Each line contains three space-separated real numbers , , and . , and have exactly digits after the decimal point.

Limits:

  • .
  • .
  • .
  • .
  • .

输出

For each test case, output one line containing Case #x: y, where x is the test case number (starting from 1) and y is the answer.

y will be considered correct if it is within an absolute or relative error of of the correct answer.

样例

Input
3
2
0.00 0.00 1.00
1.00 0.00 1.00
4
1.00 1.00 1.00
1.00 -1.00 1.00
-1.00 1.00 1.00
-1.00 -1.00 1.00
2
0.00 0.00 1.00
1.00 0.00 2.00
Output
Case #1: 1.0
Case #2: 4.0
Case #3: 1.0

2 人解决,2 已尝试。

4 份提交通过,共有 6 份提交。

9.9 EMB 奖励。

创建: 12 月前.

修改: 12 月前.

最后提交: 8 月,3 周前.

来源: Kickstart Round B 2017

标签