CF706A.Beru-taxi
入门
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
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.
瓦西里住在坐标平面上的点 (a,b) 处。他正急着去上班,因此希望尽快离开家。一款新应用为他推荐了附近可用的 n 辆贝鲁出租车。第 i 辆出租车位于点 (xi,yi),并以速度 vi 行驶。
假设这 n 名司机均会以各自的最大可能速度,沿直线直接驶向瓦西里。请计算瓦西里能够乘上任意一辆贝鲁出租车的最短时间。
输入格式
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.
输入的第一行包含两个整数 a 和 b(−100≤a,b≤100)——表示瓦西里家的坐标。
第二行包含一个整数 n(1≤n≤1000)——表示附近可用的 Beru 出租车数量。
接下来的 n 行中,第 i 行包含三个整数 xi、yi 和 vi(−100≤xi,yi≤100,1≤vi≤100)——分别表示第 i 辆出租车的坐标及其速度。
允许多辆出租车位于同一点;此外,出租车也可能恰好位于瓦西里家的位置。
输出格式
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
.
输出一个实数值——Vasiliy 到达任意一辆 Beru 出租车所需的最短时间。若你的答案的绝对误差或相对误差不超过 10−6,则视为正确。
具体而言:假设你的答案为 a,评测组的标准答案为 b。当满足
时,评测程序将判定你的答案正确。
输入输出样例
输入#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.
在第一个样例中,第一辆出租车到达瓦西里需要 2 单位时间,第二辆出租车到达需要 1 单位时间,因此答案为 1。
在第二个样例中,第 2 辆和第 3 辆汽车将同时到达。
输入解题思路,AI测评打分。不知道怎么写?