Friendly Rivalry

시간 제한2초메모리 제한1024 MB

요약
2n개의 점을 n개씩 두 팀으로 나눌 때 서로 다른 팀에 속한 가장 가까운 두 점 사이의 거리가 최대가 되도록 팀을 정한다.
난이도

어려움10점 중 9점

유형
기하, 완전 탐색, 구현, 정렬
정답자
아직 제출이 없습니다

문제

The leaders of the International Coalition for Planetary Change (ICPC), a non-profit fighting for environmental awareness, are worried that their regional chapters are not doing enough to make a real impact on climate change. Inspired by the latest studies that competition is one of the best motivators, they have decided to start a competition between their chapters.

At the same time, the ICPC does not want to slow the spread of ideas. To encourage chapters to share effective climate change methods, the ICPC has decided to assign their 2n2n chapters into two teams, the green team and the blue team. For balance, each team should consist of exactly nn chapters.

To ensure the teams are not getting in each other’s way, the ICPC wants the two teams to be as far apart as possible. Specifically, the Euclidean distance between the closest pair of chapters belonging to different teams should be as large as possible.

Help the ICPC set up the teams according to these rules.

입력

The first line contains an integer nn (1≤n≤5001 ≤ n ≤ 500), the size of each team. Chapters are numbered from 11 to 2n2n. Each of the remaining 2n2n lines contains two integers x_ix\_i and y_iy\_i (−109≤x_i,y_i≤109-10^9 ≤ x\_i, y\_i ≤ 10^9), the Cartesian coordinates of the location of the iith chapter. All chapters are at distinct locations.

출력

Output n+1n + 1 numbers. The first number is the distance between the two closest chapters belonging to different teams. The next nn numbers are the chapters belonging to the blue team. If there are multiple ways to divide the teams with the same minimal distance, output any of them. The distance should have an absolute or relative error of at most 10−610^{-6}.

예제3

  1. 예제 1

    입력
    2
    0 1
    1 0
    1 1
    0 0
    
    예상 출력
    1.000000
    1
    2
    
  2. 예제 2

    입력
    2
    0 1
    -1 -1
    1 0
    2 2
    
    예상 출력
    2.236068
    4
    2
    
  3. 예제 3

    입력
    3
    0 0
    1 1
    2 2
    3 3
    4 4
    5 5
    
    예상 출력
    1.414214
    1
    2
    3