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

建议使用的浏览器:

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

6419:Rikka with Rain

题目描述
There will always be sudden heavy rain in summer.

When the heavy rain begins, there are $m$ students on the campus. We can consider each student as a circle with radius $r$ and center $(a_i,b_i)$.

There is only one building in the school. This building can be considered as a simple polygon with $n$ vertices $(x_i,y_i)$. To get out of the rain, the students need to run into the building as quickly as possible.

As a member of the students, Rikka wants to calculate the minimum possible running distance for each student.

The following are some supplements to this task:
1. You may assume that students will not interact with each other and the circles may overlap.
2. A student is inside the building if and only if the circle is completely inside the simple polygon.
3. Students can run in any direction, and the running distance is the Euclidean distance between the initial position and the target position of the center.
输入解释
The first line contains a single integer $t(1 \leq t \leq 10)$, the numebr of the testcases.

For each testcase, the first line contains three integers $n,m,R(3 \leq n,m \leq 200, 1 \leq R \leq 10^6)$.

Then $n$ lines follows, each line contains two integers $(x_i,y_i)(|x_i|,|y_i| \leq 10^6)$, which describe the simple polygon in counter-clockwise.

Then $m$ lines follows, each line contains two integers $(a_i,b_i)(|a_i|,|b_i| \leq 10^6)$, which describe the initial position of the students.

The input guarantees that it is possible for each student to run into the building.
输出解释
For each query, let $w$ be the minimum running distance of the student. To avoid precision problem, you need to round $w$ to the nearest integer and print the result.

The input guarantees that the first decimal digit of the answer will not be $4$ or $5$ and the answer will not change if we add or subtract $R$ by $0.1$.
输入样例
1
4 4 2
0 0
4 0
4 4
0 4
1 0
2 0
10 10
-1 -2
输出样例
2
2
11
5
来自杭电HDUOJ的附加信息
Recommend chendu

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

源链接: HDU-6419

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

共提交 0

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