Codeforces Round 367 (Div. 2)
A
Beru-taxi
Codeforces
900
原题
←B →
翻译中…

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.

翻译中…

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 $*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.

翻译中…

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 image.

翻译中…

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.

翻译中…

样例

Input #1
0 0
2
2 0 1
0 2 2
Output #1
1.00000000000000000000
InputCopy OutputCopy
Input #2
1 3
3
3 3 2
-2 3 6
-2 7 10
Output #2
0.50000000000000000000
InputCopy OutputCopy
题目信息
题号
706A
时间限制
1 s
内存限制
256 MB
标签
暴力
计算几何
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。