Question 3: Activity Center time limit: 256 ms single point time limit: Ms memory limit: MB
Description
City A is A highly planned city, but residents cannot forget to exercise and exercise in high-tech areas, therefore, when designing City A, the Urban Planning Bureau should also consider building an activity center for residents so that residents living in City A can exercise and exercise their bodies and minds at any time.
The City Planning Bureau wants the location of the activity center to meet the following conditions:
1. The total distance to all places of residence is the smallest.
2. To facilitate resource supply and maintenance of other equipment in the activity center, the activity center must be built on the main road of City.
To simplify the problem, we put City A on A two-dimensional plane. The main road of the city is regarded as the X axis of the Cartesian coordinate system, and all the places of residence in the city can be considered as A point on the two-dimensional plane.
Now, City Planning Bureau A wants to know where the activity center is best.
Input
The first row contains a number T, indicating the number of data groups.
Next, it contains the T group of data. The first row of each group contains an integer N, indicating that there are N places of residence in City.
The next N rows represent the coordinates of each place of residence.
Output
For each group of data, a row "Case X: Y" is output. X indicates the number of each group of data (starting from 1), and Y indicates the optimal construction position of the activity center. We recommend that you retain the value of Y to 6 digits or more after the decimal point. Any result with an absolute error or relative error less than 10-6 from the standard answer will be considered correct.
Data range
Small Data: 1 ≤ T ≤ 1000, 1 ≤ N ≤ 10
Big Data: 1 ≤ T ≤ 10, 1 ≤ N ≤105
For all data, the coordinate value is an integer and the absolute value cannot exceed 106
Example
Example 1: the optimal construction position of the activity center is (1.678787, 0)
-
Sample Input
-
131 12 23 3
-
Sample output
-
Case 1: 1.678787