A10508 | Beru-taxi
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Vasiliy lives at point $(a,b)$ of the coordinate plane. He is hurrying up to work so he wants to get out of his house as soon as possible. New app suggested $n$ available Beru-taxi nearby. The $i$ -th taxi is located at point $(x_{i},y_{i})$ and moves with a speed $v_{i}$ .
Consider that each of $n$ drivers will move directly to Vasiliy and with a maximum possible speed. Compute the minimum time when Vasiliy will get in any of Beru-taxi cars.
Consider that each of $n$ drivers will move directly to Vasiliy and with a maximum possible speed. Compute the minimum time when Vasiliy will get in any of Beru-taxi cars.
输入格式
The first line of the input contains two integers $a$ and $b$ ( $-100<=a,b<=100$ ) — coordinates of Vasiliy's home.
The second line contains a single integer $n$ ( $1<=n<=1000$ ) — the number of available Beru-taxi cars nearby.
The $i$ -th of the following $n$ lines contains three integers $x_{i}$ , $y_{i}$ and $v_{i}$ ( $-100<=x_{i},y_{i}<=100$ , $1<=v_{i}<=100$ ) — the coordinates of the $i$ -th car and its speed.
It's allowed that several cars are located at the same point. Also, cars may be located at exactly the same point where Vasiliy lives.
The second line contains a single integer $n$ ( $1<=n<=1000$ ) — the number of available Beru-taxi cars nearby.
The $i$ -th of the following $n$ lines contains three integers $x_{i}$ , $y_{i}$ and $v_{i}$ ( $-100<=x_{i},y_{i}<=100$ , $1<=v_{i}<=100$ ) — the coordinates of the $i$ -th car and its speed.
It's allowed that several cars are located at the same point. Also, cars may be located at exactly the same point where Vasiliy lives.
输出格式
Print a single real value — the minimum time Vasiliy needs to get in any of the Beru-taxi cars. You answer will be considered correct if its absolute or relative error does not exceed $10^{-6}$ .
Namely: let's assume that your answer is $a$ , and the answer of the jury is $b$ . The checker program will consider your answer correct, if .
Namely: let's assume that your answer is $a$ , and the answer of the jury is $b$ . The checker program will consider your answer correct, if .
输入输出样例
输入 #1
0 0 2 2 0 1 0 2 2
输出 #1
1.00000000000000000000
输入 #2
1 3 3 3 3 2 -2 3 6 -2 7 10
输出 #2
0.50000000000000000000
In the first sample, first taxi will get to Vasiliy in time $2$ , and second will do this in time $1$ , therefore $1$ is the answer.
In the second sample, cars $2$ and $3$ will arrive simultaneously.
In the second sample, cars $2$ and $3$ will arrive simultaneously.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted