CF706A.Beru-taxi

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Vasiliy lives at point (a,b)(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 nn available Beru-taxi nearby. The ii -th taxi is located at point (xi,yi)(x_{i},y_{i}) and moves with a speed viv_{i} .

Consider that each of nn 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 aa and bb ( 100<=a,b<=100-100<=a,b<=100 ) — coordinates of Vasiliy's home.

The second line contains a single integer nn ( 1<=n<=10001<=n<=1000 ) — the number of available Beru-taxi cars nearby.

The ii -th of the following nn lines contains three integers xix_{i} , yiy_{i} and viv_{i} ( 100<=xi,yi<=100-100<=x_{i},y_{i}<=100 , 1<=vi<=1001<=v_{i}<=100 ) — the coordinates of the ii -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 10610^{-6} .

Namely: let's assume that your answer is aa , and the answer of the jury is bb . 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 22 , and second will do this in time 11 , therefore 11 is the answer.

In the second sample, cars 22 and 33 will arrive simultaneously.

首页