当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6459:Machining Disc Rotors

Special Judge 特殊评判
题目描述
Edward is a worker for Aluminum Cyclic Machinery.
His work is to control the mechanical arms to cut out some parts of the mould material.
Here is a brief introduction to his work.

Suppose the operation panel for him is a Euclidean plane with the coordinate system.
Originally the mould is a disc whose centre coordinates is $(0, 0)$ and of radius $R$.
Edward controls $n$ different mechanical arms to cut out and erase those all of the mould within their affected areas.
The affected area of the $i$-th mechanical arm is a circle whose centre coordinate is $(x_i, y_i)$ and of radius $r_i$.
In order to obtain the highly developed product, it is guaranteed that the affected areas of any two mechanical arms share no intersection and no one has an affected area containing the whole original mould.

Your task is to determine the diameter of the residual mould.
Here the diameter of a subset, which may not be convex, over the Euclidean plane is the supremum (i.e. the least upper bound) of distances between every two points in the subset.
Here is an illustration of the sample.
输入解释
The input contains several test cases, and the first line contains a positive integer $T$ indicating the number of test cases which is up to $5000$.

For each test case, the first line contains two integers $n$ and $R$, where $1 \le n \le 100$ and $1 \le R \le 1000$.

The following $n$ lines describe all mechanical arms controlled by Edward, the $i$-th of which contains three integers $x_i, y_i$ and $r_i$ describing the affected area of the $i$-th mechanical arm, where $-1000 \le x_i, y_i \le 1000$ and $1 \le r_i \le 1000$.
输出解释
For each test case, output a line containing "Case #x: y"(without quotes), where x is the test case number starting from $1$, and y is the diameter of the remaining area with an absolute or relative error of at most $10^{-9}$.
Precisely speaking, assume that your answer is $a$ and and the jury's answer is $b$, your answer will be considered correct if $\frac{|a - b|}{\max\{1, |b|\}} \le 10^{-9}$, where $\max\{x, y\}$ means the maximum of $x$ and $y$ and $|x|$ means the absolute value of $x$.
输入样例
1
3 10
0 12 10
11 -6 10
-11 -6 10
输出样例
Case #1: 18.611654895000252

提示
In the sample case, the diameter of the remaining area is (324+162*471^0.5/157)^0.5≈18.611654895000253, which is equal to the distance between (-8,6) and (112-27*471^0.5/157,-3-99*471^0.5/314).
来自杭电HDUOJ的附加信息
Recommend chendu

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6459

最后修改于 2020-10-25T23:31:33+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
12000/10000MS(Java/Others) 262144/262144K(Java/Others)