Thanks_up与出租车

TimeLimit:1000MS  MemoryLimit:256MB
64-bit integer IO format:%I64d
未提交 | 登录后收藏
Problem Description

图片.png

Thanks_up昨天晚上熬夜休闲打CF,然后今天早上起晚了,这是真的惨啊

现在他要赶车去相亲,,

他所在的位置是坐标平面的点(a,b)。在他的app上面周围有n个出租车司机, 第i辆出租车位于(xi,yi)点,以vi的速度移动。


现在每个出租车司机都会以最快的速度朝Thanks_up那边开,请问Thanks_up会最快坐上哪辆出租车

Input

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 xi, yi and vi ( - 100 ≤ xi, yi ≤ 100, 1 ≤ vi ≤ 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.


第一行输入两个整数a and b ( - 100 ≤ a, b ≤ 100) ,代表Thanks_up的位置

第二行输入一个整数n (1 ≤ n ≤ 1000),附近出租车的数量

接下来有n行,每i行都要三个整数xi, yi and vi ( - 100 ≤ xi, yi ≤ 100, 1 ≤ vi ≤ 100) ,代表第i辆出租车的位置以及他的速度

允许一个点有多辆出租车,且出租车可能就在Thanks_up的位置


Output

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 .


输出Thanks_up坐上出租车的最短时间,误差在10 - 6内即算做正确

SampleInput 1
0 0
2
2 0 1
0 2 2
SampleOutput 1
1.00000000000000000000
SampleInput 2
1 3
3
3 3 2
-2 3 6
-2 7 10
SampleOutput 2
0.50000000000000000000
Note

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.

Submit
题目统计信息详细
总AC数42
通过人数41
尝试人数42
总提交量56
AC率73.21%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: