A11428 | Little Brother
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Masha's little brother draw two points on a sheet of paper. After that, he draws some circles and gave the sheet to his sister.
Masha has just returned from geometry lesson so she instantly noticed some interesting facts about brother's drawing.
At first, the line going through two points, that brother drew, doesn't intersect or touch any circle.
Also, no two circles intersect or touch, and there is no pair of circles such that one circle is located inside another.
Moreover, for each circle, Masha drew a square of the minimal area with sides parallel axis such that this circle is located inside the square and noticed that there is no two squares intersect or touch and there is no pair of squares such that one square is located inside other.
Now Masha wants to draw circle of minimal possible radius such that it goes through two points that brother drew and doesn't intersect any other circle, but other circles can touch Masha's circle and can be located inside it.
It's guaranteed, that answer won't exceed $10^{12}$ . It should be held for hacks as well.
Masha has just returned from geometry lesson so she instantly noticed some interesting facts about brother's drawing.
At first, the line going through two points, that brother drew, doesn't intersect or touch any circle.
Also, no two circles intersect or touch, and there is no pair of circles such that one circle is located inside another.
Moreover, for each circle, Masha drew a square of the minimal area with sides parallel axis such that this circle is located inside the square and noticed that there is no two squares intersect or touch and there is no pair of squares such that one square is located inside other.
Now Masha wants to draw circle of minimal possible radius such that it goes through two points that brother drew and doesn't intersect any other circle, but other circles can touch Masha's circle and can be located inside it.
It's guaranteed, that answer won't exceed $10^{12}$ . It should be held for hacks as well.
输入格式
First line contains four integers $x1$ , $y1$ , $x2$ , $y2$ ( $-10^{5}<=x1,y1,x2,y2<=10^{5}$ ) — coordinates of points that brother drew. First point has coordinates ( $x1$ , $y1$ ) and second point has coordinates ( $x2$ , $y2$ ). These two points are different.
The second line contains single integer $n$ ( $1<=n<=10^{5}$ ) — the number of circles that brother drew.
Next $n$ lines contains descriptions of circles. Each line contains three integers $x_{i}$ , $y_{i}$ , $r_{i}$ ( $-10^{5}<=x_{i},y_{i}<=10^{5}$ , $1<=r_{i}<=10^{5}$ ) describing circle with center ( $x_{i}$ , $y_{i}$ ) and radius $r_{i}$ .
The second line contains single integer $n$ ( $1<=n<=10^{5}$ ) — the number of circles that brother drew.
Next $n$ lines contains descriptions of circles. Each line contains three integers $x_{i}$ , $y_{i}$ , $r_{i}$ ( $-10^{5}<=x_{i},y_{i}<=10^{5}$ , $1<=r_{i}<=10^{5}$ ) describing circle with center ( $x_{i}$ , $y_{i}$ ) and radius $r_{i}$ .
输出格式
Output smallest real number, that it's possible to draw a circle with such radius through given points in such a way that it doesn't intersect other circles.
The output is considered correct if it has a relative or absolute error of at most $10^{-4}$ .
The output is considered correct if it has a relative or absolute error of at most $10^{-4}$ .
输入输出样例
输入 #1
2 4 7 13 3 3 0 1 12 4 2 -4 14 2
输出 #1
5.1478150705
输入 #2
-2 3 10 -10 2 7 0 3 -5 -5 2
输出 #2
9.1481831923

C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted