Problem K
Saving
the Planet
Input: Standard Input
Output: Standard Output
In science fiction movies we have seen that a few man leave the Earth and go far away for better inhabitance. In reality, this Earth is our only place to live. It is our sacred duty to keep this planet away from all kinds of danger. You will now be given such a duty so don’t run away.
The scientists of Japan, Australia, USA and Russia have discovered something miserable. This discovery took place in a Laboratory of PONDS (Planet Orbit and Numerology Determination Society). A huge object is coming straight towards our planet. The problem is that its shape and size cannot be determined. The scientists discover some signals bit they are from scattered positions. A few days later they discover that the relative distances between these scattered positions (these positions can be considered points) remain constant. So they realize that these signals come from radioactive elements, which are placed on and inside of a transparent planet. The scientists are making a weapon to destroy this half visible planet. They have also hired Bruce Willis, the brave astronaut of the movie “Armageddon” (Although in the movie he died, the director kept him alive for his next movie). But the problem is the power of the weapon depends on the size of the planet. If the weapon is a little less powerful that what the planet requires to be destroyed it is ok but if it is more powerful than the exact requirement the existence of Earth will be in danger. Assuming that all the radioactive elements are within the planet and the planet is a sphere, you will have to determine the minimum radius possible of the planet from the given radio active element positions and also the coordinate of the center of the planet at the time when the sample was taken. The radioactive element positions are points in three-dimensional space (x, y, z).
Input
The input contains several sets of input. Each set
contains an integer n (n<10001) followed by n lines, which contains the coordinate of the
radioactive elements. The coordinates are measured according to ISCS
(International Space Coordinate System) rules and you don’t need to bother
about this. You just deal with the numerical values. A set with a zero value
for n ends the input.
Output
For each set of output in a single line four floating-point numbers. First numbers is the radius of the Planet and the last three numbers denote the coordinates of the center of the planet. Each number is separated by a space and contains four digits after the decimal point. Assume that pi=3.14159265359
Sample Input
10Sample Output
101.9337 3.6550 0.6000 102.3500__________________________________________________________________________________________
Shahriar Manzoor
“When the contest over and you are the champion don’t think that you are the best programmer but you may think that you are the most lucky one. Similarly, when the contest is over and you are the last … “