#P4035. [JSOI2008] 球形空间产生器

    ID: 2967 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 7 上传者: 标签>2008各省省选江苏模拟退火高斯消元构造

[JSOI2008] 球形空间产生器

Description

There is a spherical space generator that can create a rigid sphere in nn-dimensional space. Now you are trapped inside this nn-dimensional sphere. You only know the coordinates of n+1n+1 points on the sphere, and you need to determine the coordinates of the center of this nn-dimensional sphere as quickly as possible in order to destroy the spherical space generator.

Input Format

The first line contains an integer nn (1n101 \le n \le 10). The next n+1n+1 lines each contain nn real numbers, representing the nn-dimensional coordinates of a point on the sphere. Each real number is given to 66 decimal places, and its absolute value does not exceed 2000020000.

Output Format

Output exactly one line containing the nn coordinates of the center (i.e., nn real numbers), separated by a single space. Each real number must be printed to 33 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:

  1. Center: a point whose distances to all points on the sphere are equal.
  2. Distance: let two points A,BA, B in nn-dimensional space have coordinates (a1,a2,,an),(b1,b2,,bn)(a_1, a_2, \cdots, a_n), (b_1, b_2, \cdots, b_n). The distance between AA and BB 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