#P4035. [JSOI2008] 球形空间产生器
[JSOI2008] 球形空间产生器
Description
There is a spherical space generator that can create a rigid sphere in -dimensional space. Now you are trapped inside this -dimensional sphere. You only know the coordinates of points on the sphere, and you need to determine the coordinates of the center of this -dimensional sphere as quickly as possible in order to destroy the spherical space generator.
Input Format
The first line contains an integer (). The next lines each contain real numbers, representing the -dimensional coordinates of a point on the sphere. Each real number is given to decimal places, and its absolute value does not exceed .
Output Format
Output exactly one line containing the coordinates of the center (i.e., real numbers), separated by a single space. Each real number must be printed to decimal places. It is guaranteed that a solution exists. Your answer must be exactly the same as the standard output to receive points.
2
0.0 0.0
-1.0 1.0
1.0 0.0
0.500 1.500
Hint
Hint: Two definitions are given:
- Center: a point whose distances to all points on the sphere are equal.
- Distance: let two points in -dimensional space have coordinates . The distance between and is defined as $dist = \sqrt{ (a_1-b_1)^2 + (a_2-b_2)^2 + \cdots + (a_n-b_n)^2 }$.
Translated by ChatGPT 5
京公网安备 11011102002149号