QOJ.ac

QOJ

Limite de temps : 2 s Limite de mémoire : 2048 MB Points totaux : 100

#10406. 友好的竞争

Statistiques

国际行星变化联盟(ICPC)的领导者们是一个致力于提高环保意识的非营利组织,他们担心各地区分会为应对气候变化所做的贡献不足。受“竞争是最好的激励因素之一”这一最新研究的启发,他们决定在各分会之间发起一场竞赛。

与此同时,ICPC 不希望减缓思想的传播。为了鼓励各分会分享有效的气候变化应对方法,ICPC 决定将他们的 $2n$ 个分会分成两支队伍:绿队和蓝队。为了保持平衡,每支队伍必须恰好包含 $n$ 个分会。

为了确保两支队伍互不干扰,ICPC 希望两支队伍之间的距离尽可能远。具体来说,属于不同队伍的最近一对分会之间的欧几里得距离应尽可能大。

请帮助 ICPC 根据这些规则组建队伍。

输入格式

第一行包含一个整数 $n$ ($1 \le n \le 500$),表示每支队伍的大小。分会编号从 $1$ 到 $2n$。接下来的 $2n$ 行,每行包含两个整数 $x_i$ 和 $y_i$ ($-10^9 \le x_i, y_i \le 10^9$),表示第 $i$ 个分会的笛卡尔坐标。所有分会的位置各不相同。

输出格式

输出 $n+1$ 个数字。第一个数字是属于不同队伍的两个最近分会之间的距离。接下来的 $n$ 个数字是属于蓝队的分会编号。如果存在多种划分队伍的方式且具有相同的最小距离,输出其中任意一种即可。距离的绝对误差或相对误差应不超过 $10^{-6}$。

样例

样例输入 1

2
0 1
1 0
1 1
0 0

样例输出 1

1.000000
1
2

样例输入 2

2
0 1
-1 -1
1 0
2 2

样例输出 2

2.236068
4
2

样例输入 3

3
0 0
1 1
2 2
3 3
4 4
5 5

样例输出 3

1.414214
1
2
3

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.