QOJ.ac

QOJ

Time Limit: 3 s Memory Limit: 256 MB Total points: 100

#1077. 山羊绳索

Statistics

一位农夫有 $n$ 只山羊。巧合的是,他在一块田地里也有 $n$ 根固定的桩子,他想让山羊在那里吃草。他想用绳子把每只山羊系在一根桩子上。他希望给每只山羊尽可能大的活动空间,但山羊的绳子以容易缠绕而闻名,因此他不能让任何一只山羊能够进入另一只山羊的领地。他最多可以使用多少长度的绳子?

输入包含多个测试用例。每个测试用例以一个整数 $n$ ($2 \le n \le 50$) 开头,表示田地中桩子的数量。接下来的 $n$ 行,每行包含一对整数 $x$ 和 $y$ ($0 \le x \le 1,000, 0 \le y \le 1,000$),表示该桩子在田地中的笛卡尔坐标(单位为米)。没有两根桩子会位于同一位置。你可以假设田地足够大,山羊永远不会遇到边界。输入以一行包含单个 $0$ 的数据结束。

对于每个测试用例,输出一个浮点数,表示农夫最多可以使用的绳子总长度(单位为米)。输出该值时需保留小数点后两位,并进行四舍五入。不要输出空格,也不要在答案之间输出空行。

样例

输入格式 1

2
250 250
250 750
3
250 250
500 500
250 750
0

输出格式 1

500.00
603.55

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.