2415. Coconut Crisis

单点时限: 3.0 sec

内存限制: 256 MB

Ken Marineblue, a space hunter traveling the universe, is looking for the space coconut crab. The space coconut crab is a crustacean known to be the largest in the universe. It is said that the space coconut crab has a body of more than 400 meters long and a leg span of no shorter than 1000 meters long. Although there are numerous reports by people who see the space coconut crab, nobody have yet succeeded in capturing it. However, it is not directly related to this problem.

A police inspector of the Universal Guardians Lail Claimer, a friend of Ken, is an elite and promising. Nowadays, Lail is controlling space hunters acting illegally. Under this work, Lail found Night Mayor, a large-scale illegal space hunter mafia.

Lail could not leave Night Mayor related to various crimes. Therefore Lail decided to conduct an annihilation operation of the Night Mayor. The operation is to search n bases of Night Mayor in the universe simultaneously. In this operation, Lail should enclose all bases of Night Mayor with spherical barrier to prevent taking out some important evidences by phase-drive, the latest warp technology.

Your job is to write a program to calculate the smallest radius of barrier and its coordinate of center from given coordinates of bases.

输入格式

Input consists of multiple test cases. The first line of each test case contains a single positive integer n ( 1 < n <= 10,000 ), which indicates the number of bases of Night Mayor. In the following n lines, each line contains three real numbers x , y , z indicating x-coordinate, y-coordinate and z-coordinate of a base of Night Mayor respectively. Input is terminated by a case of n = 0, and it should not be processed.

You can assume that coordinates of the bases are different from others. You can also assume that there is no real number larger than 10,000 in magnitude.

输出格式

For each test case, you should output x-coordinate, y-coordinate, z-coordinate and radius of required barrier in four floating-point numbers rounded off its fifth decimal place, and these numbers should be separated by a single space.

Note for C++:

Using “cin” for taking input may cause Time Limit Exceeded. For taking input, we recommend you to use standard C functions such as “scanf” instead of “cin”.

样例

Input
6
1 0 0
0 1 0
0 0 1
-1 0 0
0 -1 0
0 0 -1
2
0 0 0
1 0 0
0
Output
0.0000 0.0000 0.0000 1.0000
0.5000 0.0000 0.0000 0.5000

0 人解决,3 人已尝试。

0 份提交通过,共有 3 份提交。

9.9 EMB 奖励。

创建: 16 年,1 月前.

修改: 7 年,4 月前.

最后提交: 4 年,1 月前.

来源: Winter Contest 2008

题目标签