F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

N-dimensional Sphere

Time 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
2 2 1 0 -1 0 0 1 3 2 2 3 0 2 3 1 3 3 1 2 4
 

Sample Output
Case 1: 0 0 Case 2: 1 2 3
 

Author
stephydx
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-26 14:06:09, Gzip enabled