#P16629. [GKS 2017 #E] Blackhole

    ID: 18985 远端评测题 1000ms 1024MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>计算几何2017Special JudgeGoogle Kick Start

[GKS 2017 #E] Blackhole

Problem Description

Alice is trying to prevent dangerous black holes from threatening Earth. Right now, there are three black holes that are different points in 3-D space. Alice will create exactly three containment spheres, and all three must have the same radius. Spheres do not interfere with each other, so they may overlap.

Alice must place these spheres so that each black hole is covered by at least one sphere. Moreover, to ensure stability, the total set of points covered by at least one sphere must form a single connected area.

Alice wants to solve this critical problem as inexpensively as possible. What is the minimum radius that she can use?

Input Format

The input starts with one line with one integer TT: the number of test cases. TT test cases follow. Each test case consists of three lines. The i-th of those lines consists of three integers XiX_i, YiY_i, and ZiZ_i, representing the 3-D coordinates of the i-th black hole.

Output Format

For each test case, output one line Case #x: y, where x is the test case number (starting from 1) and y is a rational representing the minimum radius that Alice can use to solve the problem. y will be considered correct if it is within an absolute or relative error of 10610^{-6} of the correct answer. See the FAQ for an explanation of what that means, and what formats of real numbers we accept.

4
0 0 0
1 0 0
-1 0 0
4 0 0
5 0 0
-2 0 0
0 0 0
1 1 1
-1 -1 -1
-4 2 -2
5 1 -4
0 4 -9
Case #1: 0.3333333333
Case #2: 1.1666666667
Case #3: 0.5773502692
Case #4: 2.1373179212

Hint

Note that the last two sample cases would not appear in the Small dataset.

In Sample Case #1, the smallest radius we can use is 1/31/3. Our three spheres should be centered at (2/3,0,0),(0,0,0)(-2/3, 0, 0), (0, 0, 0), and (2/3,0,0)(2/3, 0, 0).

Limits

1000Xi1000-1000 \le X_i \le 1000, for all i.

For all j \ne k, (Xj,Yj,Zj)(Xk,Yk,Zk)(X_j, Y_j, Z_j) \ne (X_k, Y_k, Z_k). (No two of the points have the same coordinates.)

Small dataset (Test set 1 - Visible)

Yi=0Y_i = 0, for all i.

Zi=0Z_i = 0, for all i.

Large dataset (Test set 2 - Hidden)

1000Yi1000-1000 \le Y_i \le 1000, for all i.

1000Zi1000-1000 \le Z_i \le 1000, for all i.