ZOJ Problem Set - 2928
This year's mathematical contest in modeling in ZJU will come soon. The students loving the contest have already made their teams. We consider a simple model: A team contains three students, one of them is good at maths, the second of them is good at computer, and the third one is good at writing. Now they want to estimate their team's relative power level in all participant teams. They use their grades in school instead of their real modeling abilities now because before the contest no other criterions more properly can be used. The grade of a student is a nonnegative real number no more than 1000. A team's modeling ability can be represented by three real numbers a, b, and c. a is the grade of the student which is good at maths, b is the grade of the one which is good at computer, and c is the grade of the one which is good at writing. If they know the average modeling ability of all teams, each team can compare their own team's modeling ability with the average modeling ability and then estimates their relative modeling power level in all teams.
Assume two teams' modeling abilities are a1, b1, c1 and a2, b2, c2 respectively, then the difference between their modeling abilities is defined as sqrt((a1-a2)^2+(b1-b2)^2+(c1-c2)^2). The average modeling ability of all teams is three real numbers which can be considered as a team's modeling ability, and the sum of the differences between this modeling ability and all teams' modeling abilities is minimum.
Your task is to calculate the average modeling ability of all teams.
There are multiple test cases. Each teat case begins with a line containing a integer n, 3 <= n <= 100, which is the number of all teams. Then n lines follow, each line contains three real numbers ai, bi and ci, 0.00 <= ai, bi, ci <= 1000.00, which is a team's modeling ability.
For each test case, print the average modeling ability of all teams in a line rounded to three decimal places after the decimal point. It is guaranteed that the answer is unique.
250.000 250.000 250.000
Author: HE, Rongqiang
Source: ZOJ Monthly, February 2008