A10545 | ...Dary!
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Barney has finally found the one, a beautiful young lady named Lyanna. The problem is, Lyanna and Barney are trapped in Lord Loss' castle. This castle has shape of a convex polygon of $n$ points. Like most of castles in Demonata worlds, this castle has no ceiling.
Barney and Lyanna have an escape plan, but it requires some geometry knowledge, so they asked for your help.
Barney knows that demons are organized and move in lines. He and Lyanna want to wait for the appropriate time so they need to watch for the demons. Each of them wants to stay in a point inside the castle (possibly on edges or corners), also they may stay in the same position. They both want to pick a real number $r$ and watch all points in the circles with radius $r$ around each of them (these two circles may overlap).
We say that Barney and Lyanna are watching carefully if and only if for every edge of the polygon, at least one of them can see at least one point on the line this edge lies on, thus such point may not be on the edge but it should be on edge's line. Formally, each edge line should have at least one common point with at least one of two circles.
The greater $r$ is, the more energy and focus they need. So they asked you to tell them the minimum value of $r$ such that they can watch carefully.
Barney and Lyanna have an escape plan, but it requires some geometry knowledge, so they asked for your help.
Barney knows that demons are organized and move in lines. He and Lyanna want to wait for the appropriate time so they need to watch for the demons. Each of them wants to stay in a point inside the castle (possibly on edges or corners), also they may stay in the same position. They both want to pick a real number $r$ and watch all points in the circles with radius $r$ around each of them (these two circles may overlap).
We say that Barney and Lyanna are watching carefully if and only if for every edge of the polygon, at least one of them can see at least one point on the line this edge lies on, thus such point may not be on the edge but it should be on edge's line. Formally, each edge line should have at least one common point with at least one of two circles.
The greater $r$ is, the more energy and focus they need. So they asked you to tell them the minimum value of $r$ such that they can watch carefully.
输入格式
The first line of input contains a single integer $n$ ( $3<=n<=300$ ) — the number of castle polygon vertices.
The next $n$ lines describe the polygon vertices in counter-clockwise order. $i$ -th of them contains two integers $x_{i}$ and $y_{i}$ ( $|x_{i}|,|y_{i}|<=10^{4}$ ) — the coordinates of $i$ -th point of the castle. It is guaranteed that given points form a convex polygon, in particular, any three of them do not line on the same line.
The next $n$ lines describe the polygon vertices in counter-clockwise order. $i$ -th of them contains two integers $x_{i}$ and $y_{i}$ ( $|x_{i}|,|y_{i}|<=10^{4}$ ) — the coordinates of $i$ -th point of the castle. It is guaranteed that given points form a convex polygon, in particular, any three of them do not line on the same line.
输出格式
In the first line print the single number $r$ — minimum radius of guys' watching circles.
In the second line print the pair of coordinates of point where Barney should stay.
In the third line print the pair of coordinates of point where Lyanna should stay.
Points should lie inside the polygon.
Coordinates may not be integers. If there are multiple answers print any of them.
Your answer will be considered correct if its absolute or relative error doesn't exceed $10^{-6}$ .
In the second line print the pair of coordinates of point where Barney should stay.
In the third line print the pair of coordinates of point where Lyanna should stay.
Points should lie inside the polygon.
Coordinates may not be integers. If there are multiple answers print any of them.
Your answer will be considered correct if its absolute or relative error doesn't exceed $10^{-6}$ .
输入输出样例
输入 #1
4 -41 67 -16 20 25 25 -36 85
输出 #1
0 -16 20 -36 85
输入 #2
7 -7 54 -5 31 -2 17 20 19 32 23 34 27 26 57
输出 #2
2.9342248 32.019503 23.0390067 -6.929116 54.006444
In the first example guys can stay in opposite corners of the castle.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted