Pasture 1 | 프로그래밍의 벗 PivotOJ
PivotOJ

Pasture 1

시간 제한: 1000ms메모리 제한: 1024MB출처: EIO 2021-22 openBOJ 29852

문제

Farmer John has NN posts on his pasture. The pasture can be modeled as a coordinate plane where each post has integer coordinates.

John wants to connect the posts with wire segments that do not cross (in other words, the wire segments may only touch at their common endpoints) and form a number of triangular enclosures for his sheep. The sheep are fairly selfish, so each of them needs to be in a separate enclosure.

As the business is not going particularly well at the moment, John would like to use as litte wire as possible. Help him arrange the wire segments so that the total length of wire used is as small as possible, but he can accommodate the maximal number of sheep. John has a limited amount of wire and cannot use more than that.

입력

The first line contains NN, the number of posts on the pasture (3N100003 \le N \le 10\,000), and the integer MM, the total length of wire that John has (1M10101 \le M \le 10^{10}). Each of the following NN lines contains two integers XiX_i and YiY_i, the coordinates of one fencepost (105Xi,Yi105-10^5 \le X_i, Y_i \le 10^5). The posts are numbered 1N1 \ldots N in the order of their appearance in the input.

출력

The first line should contain KK, the number of wire segments, and LL, the total length of wire spent. Each of the following KK lines should contain two integers AA and BB, indicating that one of the wire segments should connect the posts AA and BB. The total length of wire, LL, should be given with exactly 66 decimal digits.

예제

예제 1

입력
4 19
0 0
0 3
3 0
4 3
출력
5 17.404918
1 2
2 4
4 3
3 1
2 3
이 문제는 채점 준비 중입니다. 테스트 데이터가 확보되면 제출이 가능합니다.