QOJ.ac

QOJ

時間限制: 1 s 記憶體限制: 2048 MB 總分: 100

#8653. 陨石坑

统计

Warren Pierce 将军遇到了一个难题。他负责一种新型无人机投送的爆炸物,并一直在内华达沙漠中进行测试,这里远离任何人口中心,以避免平民伤亡和窥探。不幸的是,关于这些实验的消息已经传了出去,现在可能会有粗心的旁观者、邪恶的间谍,甚至更糟糕的情况——爱管闲事的记者!为了让他们远离测试区域,Warren 想要架设一道单一的围栏,将爆炸产生的所有圆形弹坑包围起来。然而,由于各种削减经费的原因(为了支持你懂的那位的减税政策),他不能像过去那样架设数英里的围栏。他认为,如果能让人们与任何弹坑保持至少 10 码的距离,那就没问题了,但他不确定需要申请多少围栏。给定弹坑的位置和大小,你能帮助将军确定他所需的最少围栏长度吗?下图展示了一个包含三个弹坑(在样例输入 1 中指定)的示例。

图 B.1:三个弹坑及其周围的围栏。

输入格式

输入的第一行包含一个正整数 $n$ ($n \le 200$),表示弹坑的数量。接下来的 $n$ 行指定了每个弹坑的位置和半径。每一行包含 3 个整数 $x, y, r$,其中 $x$ 和 $y$ 指定了弹坑的位置 ($|x, y| \le 10\,000$),$r$ 是其半径 ($0 < r \le 5\,000$)。所有单位均为码。

输出格式

输出围住这些弹坑(并确保人们与任何弹坑保持至少 10 码距离)所需的最少围栏长度(单位为码),绝对或相对误差不超过 $10^{-6}$。

样例

输入格式 1

3
0 0 100
-60 200 40
350 50 150

输出格式 1

1715.91229929

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.