The beautiful coastal city of Nha Trang is famous for its many tourist attractions as well as island clusters with many attractive landscapes and white sand beaches stretching along the coast, poetic beaches, pagodas, churches, and famous ancient temples that attract many domestic and foreign tourists to visit and relax. For the convenience of tourists visiting famous tourist attractions in the city, the city leaders decided to build a mixed wharf including both yachts and for road vehicles. After a period of discussion, asking for opinions from tourists and people, the provincial leaders decided to choose one of the tourist destinations to build a mixed wharf. The most important thing is to make the total distance from the point chosen to build the wharf to all other tourist attractions as small as possible. Consider N as tourist destinations on a 2-dimensional coordinate plane, each tourist destination is represented by a pair of coordinates ~(x_i, y_i)~, the distance between points on the coordinate plane is the distance between 2 tourist destinations in the city. Requirement: Find the most suitable location to build a mixed wharf according to the problem requirements. If there is more than 1 result, choose the wharf with the smallest code number.
Input: From the standard device in the following format:
- The first line records a positive integer n (0 ≤ n ≤ 100);
- The next n lines, each line records 2 integers ~x_i, y_i~ representing the coordinates of the i-th point.
Output: Write to the standard device a single line containing 2 numbers, the first number is the code number of the found point and the second number is a real number representing the smallest total distance to the remaining points (take 3 decimal places).
Exam:
Input
3
5 9
2 11
-2 5
Ouput
2 10.817
Comments