P4035 [JSOI2008] Spherical Space Generator

Description

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

Input Format

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

Output Format

Output exactly one line containing the $n$ coordinates of the center (i.e., $n$ real numbers), separated by a single space. Each real number must be printed to $3$ decimal places. It is guaranteed that a solution exists. Your answer must be exactly the same as the standard output to receive points.

Explanation/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, B$ in $n$-dimensional space have coordinates $(a_1, a_2, \cdots, a_n), (b_1, b_2, \cdots, b_n)$. The distance between $A$ and $B$ 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