|
||||||||||
N-dimensional SphereTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 881 Accepted Submission(s): 366 Problem Description In an N-dimensional space, a sphere is defined as {(x1, x2 ... xN)| ¡Æ(xi-Xi)^2 = R^2 (i=1,2,...,N) }. where (X1,X2¡XN) is the center. You're given N + 1 points on an N-dimensional sphere and are asked to calculate the center of the sphere. Input The first line contains an integer T which is the number of test cases. For each case there's one integer N on the first line. Each of the N+1 following lines contains N integers x1, x2 ... xN describing the coordinate of a point on the N-dimensional sphere. (0 <= T <= 10, 1 <= N <= 50, |xi| <= 10^17) Output For the kth case, first output a line contains ¡°Case k:¡±, then output N integers on a line indicating the center of the N-dimensional sphere (It's guaranteed that all coordinate components of the answer are integers and there is only one solution and |Xi| <= 10^17) Sample Input
Sample Output
Author stephydx Source | ||||||||||
|