|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|5 초||512 MB||1||1||1||100.000%|
The Country of Everlasting is planning to build a rail line that will connect its cities. During their planning stage, they have decided that the route where the rail line will pass should minimize the distance between the cities and the rail line. During the canvassing of materials, the engineers involved found out that it will be best if they buy pre-fabricated guideways from the country of Forever. However, the only available prefabricated guideways are the straight guideways. If the selected route is not a straight line (for example, the figure below), then they will need to buy several pre-fabricated guideways. They can buy guideways of different lengths.
The problem now is that there is an overhead cost C for each pre-fabricated guideway imported from Forever. So they have to design the route such that the value a + bC is minimized, where:
The first line of input contains T, the number of test cases.
The first line of each test case contains two numbers separated by a space: the integer n and the real number C. The next n lines describe the cities.
The ith subsequent line contains two integers xi and yi denoting the coordinates of the ith city.
For each test case, output a single line containing a single real number: the optimal value of a + bC. Your solution must be accurate to within an absolute error of 10−2 from the correct answer.
2 10 1.0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 8 2.0 1 1 2 2 3 1 4 2 5 1000 6 999 7 1000 8 999