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 $\frac{|a - b|}{\operatorname{max}(1, b)} \leq 10^{-6}$.


-----Examples-----
Input
0 0
2
2 0 1
0 2 2

Output
1.00000000000000000000
Input
1 3
3
3 3 2
-2 3 6
-2 7 10

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

Source: codeforces | Difficulty: EASY
Tags: Geometry

Implementation

Complete search


Solutions:
import math
(x, y) = map(int, input().split())
t = int(input())
res = []
for _ in range(t):
	(a, b, v) = map(int, input().split())
	c = x - a
	if c < 0:
		c = 0 - c
	d = y - b
	if d < 0:
		d = 0 - d
	dis = c * c + d * d
	dis = math.sqrt(dis)
	l = dis / v
	res.append(l)
k = min(res)
print('{0:.20f}'.format(k))


import math
(homex, homey) = [int(i) for i in input().split()]
amount = int(input())
mintime = 400
for i in range(amount):
	(x, y, v) = [int(i) for i in input().split()]
	dist = math.sqrt((x - homex) ** 2 + (y - homey) ** 2)
	if dist / v < mintime:
		mintime = dist / v
print(mintime)


import math
(a, b) = map(float, input().split())
n = int(input())
x = []
y = []
v = []
xx = 0.0
yy = 0.0
vv = 0.0
mini = 1000000.0
for i in range(n):
	(xx, yy, vv) = map(float, input().split())
	x.append(xx)
	y.append(yy)
	v.append(vv)
for i in range(n):
	mini = min(mini, math.sqrt((x[i] - a) ** 2 + (y[i] - b) ** 2) / v[i])
print(mini)


(a, b) = (int(i) for i in input().split())
n = int(input())
k = 500
for i in range(n):
	(c, d, v) = map(int, input().split())
	k = min(k, ((a - c) ** 2 + (b - d) ** 2) ** 0.5 / v)
print(k)


(x, y) = input().split()
(x, y) = (int(x), int(y))
n = input()
n = int(n)
f = []
for i in range(n):
	(a, b, c) = input().split()
	(a, b, c) = (int(a), int(b), int(c))
	t = ((a - x) ** 2 + (b - y) ** 2) ** 0.5
	t /= c
	f.append(t)
f.sort()
print(f[0])


(x1, y1) = map(int, input().split())
n = int(input())
res = {}
for _ in range(n):
	(x2, y2, v2) = map(int, input().split())
	d = ((x2 - x1) ** 2 + (y2 - y1) ** 2) ** 0.5
	v = d / v2
	res[v] = res.get(v, 0) + 1
min_num = sorted(res)[0]
print(min_num)


(a, b) = list(map(int, input().split()))
m = 100000
for i in range(int(input())):
	(x, y, v) = list(map(int, input().split()))
	d = (x - a) * (x - a) + (y - b) * (y - b)
	d = d ** 0.5
	t = abs(d / v)
	if t < m:
		m = t
print(m)


import math
(a, b) = map(int, input().split())
q = int(input())
m = 1000000
while q > 0:
	(x, y, v) = map(int, input().split())
	z = math.sqrt((a - x) * (a - x) + (b - y) * (b - y))
	x1 = z / v
	if m > x1:
		m = x1
	q = q - 1
print(f'{m:.20f}')


def distance(x1, y1, x2, y2):
	return ((x2 - x1) ** 2 + (y2 - y1) ** 2) ** 0.5

def time(s, v):
	return s / v
(a, b) = map(int, input().split())
t = []
for i in range(int(input())):
	(x, y, v) = map(int, input().split())
	t.append(time(distance(a, b, x, y), v))
print(min(t))


vasily = list(map(int, input().split()))
n_taxi = int(input())
lista = []
for i in range(n_taxi):
	xyv = list(map(int, input().split()))
	d = ((xyv[0] - vasily[0]) ** 2 + (xyv[1] - vasily[1]) ** 2) ** 0.5
	t = d / xyv[2]
	lista += [t]
m = min(lista)
print(m)


(a, b) = map(int, input().split())
n = int(input())
t = []
for _ in range(n):
	(x, y, s) = map(int, input().split())
	d = ((x - a) ** 2 + (y - b) ** 2) ** 0.5
	t.append(d / s)
print(min(t))


(a, b) = map(int, input().split())
n = int(input())
m = 100000000
for _ in range(n):
	i = list(map(int, input().split()))
	d = ((i[0] - a) ** 2 + (i[1] - b) ** 2) ** 0.5 / i[2]
	if d < m:
		m = d
print(m)


import math
(a, b) = map(int, input().split())
n = int(input())
v = 1e+25
for i in range(n):
	(x, y, z) = map(int, input().split())
	v = min(v, math.sqrt((a - x) ** 2 + (b - y) ** 2) / z)
print(v)


(a, b) = map(int, input().split())
n = int(input())
ans = 10 ** 30
for i in range(n):
	(x, y, v) = map(int, input().split())
	x -= a
	y -= b
	x = x ** 2
	y = y ** 2
	ans = min(ans, (x + y) ** 0.5 / v)
print(ans)


(a, b) = (int(i) for i in input().split())
m = 100000000
n = int(input())
for i in range(n):
	(x, y, v) = (int(j) for j in input().split())
	m = min(m, ((a - x) ** 2 + (b - y) ** 2) ** 0.5 / v)
print(m)


from math import sqrt
(a, b) = map(int, input().split())
n = int(input())
time = 1000000000
for i in range(n):
	(x, y, v) = map(int, input().split())
	s = sqrt((x - a) ** 2 + (y - b) ** 2)
	time = min(time, s / v)
print('%6f' % time)


(a, b) = list(map(int, input().split()))
n = int(input())
ans = []
for x in range(n):
	(i, j, k) = list(map(int, input().split()))
	dist = ((i - a) ** 2 + (j - b) ** 2) ** 0.5
	ans.append(dist / k)
l = ans[0]
for y in ans[1:]:
	if y < l:
		l = y
print(l)


import math
(a, b) = map(int, input().split())
n = int(input())
drivers = []
min_time = float('inf')
for i in range(n):
	drivers.append(list(map(int, input().split())))
for driver in drivers:
	(x, y, v) = driver
	d = math.sqrt((a - x) ** 2 + (b - y) ** 2)
	time = d / v
	if time < min_time:
		min_time = time
print('{:.16f}'.format(min_time))


import math
(a, b) = map(int, input().split())
n = int(input())
m = 90000.0
for _ in range(n):
	(x, y, v) = map(int, input().split())
	x -= a
	y -= b
	m = min(m, (x * x + y * y) / (v * v))
print(math.sqrt(m))


(a, b) = map(int, input().split())
times = []
for _ in range(int(input())):
	(x, y, v) = map(int, input().split())
	times.append(((a - x) ** 2 + (b - y) ** 2) ** 0.5 / v)
print(min(times))


import math
(a, b) = map(int, input().split())
n = int(input())
t = 300.0
for i in range(n):
	(x, y, v) = map(int, input().split())
	t = min(t, math.sqrt((a - x) * (a - x) + (b - y) * (b - y)) / v)
print('%.9f' % t)


import math
(xv, yv) = [int(i) for i in input().split()]
n = int(input())
time = []
for i in range(n):
	(x, y, v) = [int(i) for i in input().split()]
	t = math.sqrt((x - xv) ** 2 + (y - yv) ** 2) / v
	time.append(t)
print(min(time))


r = lambda : list(map(int, input().split()))
(x, y) = r()
n = int(input())
d = lambda l: (abs(l[0] - x) ** 2 + abs(l[1] - y) ** 2) ** 0.5 / l[2]
print(min((d(r()) for _ in range(n))))


from math import hypot
(a, b) = map(int, input().split())
n = int(input())
ans = 10 ** 6
for _ in range(n):
	(x, y, v) = map(int, input().split())
	ans = min(ans, hypot(x - a, y - b) / v)
print('{:.20f}'.format(ans))


(a, b) = map(int, input().split())
ans = 10000000.0
for i in range(int(input())):
	(xi, yi, vi) = map(int, input().split())
	ans = min(ans, ((xi - a) ** 2 + (yi - b) ** 2) ** 0.5 / vi)
print(ans)


I = lambda : map(int, input().split())
(a, b) = I()
m = 9 ** 9
for _ in range(next(I())):
	(x, y, v) = I()
	m = min(m, ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v)
print(m)


(x0, y0) = list(map(int, input().split()))
n = int(input())
x = []
y = []
v = []
for i in range(n):
	(x1, y1, v1) = list(map(int, input().split()))
	x.append(x1)
	y.append(y1)
	v.append(v1)
zipped = zip(x, y, v)
t = []
for i in zipped:
	s = ((i[0] - x0) ** 2 + (i[1] - y0) ** 2) ** (1 / 2)
	t.append(s / i[2])
print(min(t))


from math import hypot
(a, b) = map(int, input().split())
res = 1e+308
for i in range(int(input())):
	(x, y, v) = map(int, input().split())
	res = min(res, hypot(a - x, b - y) / v)
print(res)


import sys, math
(a, b) = map(int, sys.stdin.readline().split())
n = int(input())
ans = []
for _ in range(n):
	(x, y, v) = map(int, sys.stdin.readline().split())
	t = math.sqrt((x - a) ** 2 + (y - b) ** 2) / v
	ans.append(t)
print(min(ans))


from math import sqrt

def dist(a, b):
	return sqrt((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2)
p = [int(i) for i in input().split()]
n = int(input())
ans = -1
for _ in range(n):
	q = [int(i) for i in input().split()]
	t = dist(p, q) / q[2]
	if ans == -1:
		ans = t
	ans = min(ans, t)
print(ans)


from math import sqrt
n = input().split()
s = int(n[0])
d = int(n[1])
v = int(input())
c = 111111111111111111111111111111111111111111111111111111111111111111111111
for i in range(v):
	i = input().split()
	if c >= sqrt((int(i[0]) - s) ** 2 + (int(i[1]) - d) ** 2) / int(i[2]):
		c = sqrt((int(i[0]) - s) ** 2 + (int(i[1]) - d) ** 2) / int(i[2])
print(c)


import math
(a, b) = input().split()
n = input()
(a, b, n) = (int(a), int(b), int(n))
min = float(200 * 10 * 15)
for i in range(n):
	(x, y, v) = input().split()
	(x, y, v) = (int(x), int(y), int(v))
	s = math.sqrt((x - a) ** 2 + (y - b) ** 2)
	t = s / v
	if t < min:
		min = t
print(min)


class point:
	x = 0
	y = 0
	d = 0

	def __init__(self, a, b, c):
		self.x = a
		self.y = b
		self.d = c

def dist(p, q):
	return ((p.x - q.x) * (p.x - q.x) + (p.y - q.y) * (p.y - q.y)) ** 0.5
(a, b) = map(int, input().split())
inicio = point(a, b, 0)
taxi = int(input())
res = 0
d = 1000000000000
for i in range(1, taxi + 1, 1):
	(a, b, c) = map(int, input().split())
	p = point(a, b, c)
	if inicio.x == p.x and inicio.y == p.y:
		d = 0.0
		break
	parcial = dist(inicio, p) / c
	if d > parcial:
		d = parcial
		res = i
print('{0:.20f}'.format(d))


import math

def dist2(x1, y1, x2, y2):
	dx = x1 - x2
	dy = y1 - y2
	return dx * dx + dy * dy
(a, b) = map(float, input().split())
n = int(input())
taxis = [list(map(float, input().split())) for _ in range(n)]
taxis.sort(key=lambda k: math.sqrt(dist2(a, b, k[0], k[1])) / k[2])
d = math.sqrt(dist2(a, b, taxis[0][0], taxis[0][1])) / taxis[0][2]
print(d)


def dist(a, b, x, y, v):
	d = pow(pow(x - a, 2) + pow(y - b, 2), 0.5)
	t = d / v
	return t
(a, b) = map(int, input().split())
n = int(input())
mind = float('inf')
for i in range(n):
	(x, y, v) = map(int, input().split())
	temp = dist(a, b, x, y, v)
	if temp < mind:
		mind = temp
print(mind)


import math
(a, b) = [int(s) for s in input().split(' ')]
n = int(input())
taxi_time = float('inf')
for i in range(n):
	(x_i, y_i, v_i) = [int(s) for s in input().split(' ')]
	taxi_time = min(taxi_time, math.sqrt((x_i - a) ** 2 + (y_i - b) ** 2) / v_i)
print(taxi_time)


import math
(a, b) = map(int, input().split())
n = int(input())
t = float('inf')
for i in range(n):
	(x, y, v) = map(int, input().split())
	t = min(t, math.sqrt((x - a) ** 2 + (y - b) ** 2) / v)
print(t)


(a, b) = [int(i) for i in input().split()]
n = int(input())
(x, y, v) = [int(i) for i in input().split()]
minim = ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v
for i in range(1, n):
	(x, y, v) = [int(i) for i in input().split()]
	cur = ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v
	if cur < minim:
		minim = cur
print(minim)


from math import *
(a, b) = map(int, input().split())
n = int(input())
l = list()
for i in range(n):
	(x, y, v) = map(int, input().split())
	t = sqrt((x - a) ** 2 + (y - b) ** 2) / v
	l.append(t)
print(min(l))


def main():
	from math import hypot
	(a, b) = map(float, input().split())
	res = []
	for _ in range(int(input())):
		(x, y, v) = map(float, input().split())
		res.append(hypot(x - a, y - b) / v)
	print(min(res))
main()


import math

def solve(x0, y0):
	(x1, y1, v) = [int(x) for x in input().split(' ')]
	return math.sqrt((x1 - x0) ** 2 + (y1 - y0) ** 2) / v
(x0, y0) = [int(x) for x in input().split(' ')]
t = int(input())
Min = float('inf')
for i in range(t):
	Min = min(Min, solve(x0, y0))
print(Min)


from math import sqrt
(a, b) = map(int, input().split())
n = int(input())
m = 10 ** 9

def d(a, b, x, y):
	return sqrt((a - x) ** 2 + (b - y) ** 2)
for i in range(n):
	(x, y, v) = map(int, input().split())
	ans = d(a, b, x, y) / v
	if ans < m:
		m = ans
print(m)


from math import sqrt
ab = input().split()
n = int(input())
ax = int(ab[0])
by = int(ab[1])
times = []
for i in range(n):
	j = input().split()
	x = int(j[0])
	y = int(j[1])
	speed = int(j[2])
	d = sqrt((x - ax) ** 2 + (y - by) ** 2) / speed
	times.append(d)
print(min(times))


(a, b) = map(int, input().split())
n = int(input())
res = []
for i in range(n):
	(x, y, v) = map(int, input().split())
	res += [pow((a - x) ** 2 + (b - y) ** 2, 0.5) / v]
res.sort()
print('%.8f' % res[0])


(x, y) = map(float, input().split())
loc_lis = [input().split() for i in range(int(input()))]
print('%.6f' % min(((abs(x - float(i[0])) ** 2 + abs(y - float(i[1])) ** 2) ** 0.5 / float(i[2]) for i in loc_lis)))


from math import sqrt
dist = lambda p1, p2: sqrt(sum([(p1[i] - p2[i]) ** 2 for i in range(len(p1))]))
(a, b) = list(map(int, input().split()))
taxil = [list(map(int, input().split())) for _ in range(int(input()))]
print(min([dist([a, b], t[:2]) / t[2] for t in taxil]))


(a, b) = map(int, input().split())
n = int(input())
t = []
for _ in range(n):
	(x, y, v) = map(float, input().split())
	t.append(((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v)
print(min(t))


from math import *

def main():
	(a, b) = list(map(int, input().split()))
	n = int(input())
	T = 10 ** 10
	for loop in range(n):
		(x, y, v) = list(map(int, input().split()))
		d = sqrt((a - x) ** 2 + (b - y) ** 2)
		t = d / v
		T = min(t, T)
	print(T)
main()


import time
import math
(a, b) = (int(i) for i in input().split())
n = int(input())
t = float('Inf')
for i in range(n):
	(x, y, v) = (int(i) for i in input().split())
	new_t = math.sqrt((x - a) * (x - a) + (y - b) * (y - b)) / v
	if new_t < t:
		t = new_t
start = time.time()
print(t)
finish = time.time()


(a, b) = map(int, input().split())
n = int(input())
l = []
for i in range(n):
	(x, y, v) = map(int, input().split())
	r = round((abs(x - a) ** 2 + abs(y - b) ** 2) ** 0.5 / v, 9)
	l.append(r)
print(min(l))


import math
(a, b) = map(int, input().split())
n = int(input())
mini = float('Inf')
for _ in range(n):
	(x, y, t) = map(int, input().split())
	mini = min(math.sqrt(abs(x - a) ** 2 + abs(y - b) ** 2) / t, mini)
print(mini)


import sys
from math import sqrt
(a, b) = map(int, input().split())
n = int(input())
mini = 99999
for i in range(n):
	(x, y, v) = map(int, input().split())
	t = sqrt((x - a) ** 2 + (y - b) ** 2) / (v * 1.0)
	if t < mini:
		mini = t
print(mini)


import math
(a, b) = map(int, input().split())
n = int(input())
mn = 2147483647.0
for i in range(n):
	(x, y, v) = map(int, input().split())
	mn = min(math.sqrt((a - x) ** 2 + (b - y) ** 2) / v, mn)
print(mn)


(a, b) = map(int, input().split())
n = int(input())

def solve(a, b, c, d, v):
	return (abs(a - c) ** 2 + abs(b - d) ** 2) ** 0.5 / v
ans = 1000000000.0
for i in range(n):
	(x, y, v) = map(int, input().split())
	ans = min(ans, solve(a, b, x, y, v))
print(ans)


import math
(x, y) = map(int, input().split())
t = int(input())
l = []
for i in range(t):
	(a, b, v) = map(int, input().split())
	c = abs(x - a)
	d = abs(y - b)
	d = math.sqrt(c * c + d * d)
	r = d / v
	l.append(r)
ans = min(l)
print('{0:.20f}'.format(ans))


from math import *
(a, b) = (int(z) for z in input().split())
m = 10 * 1000
hhh = int(input())
for i in range(hhh):
	(x, y, v) = (int(z) for z in input().split())
	m = min(m, ((a - x) ** 2 + (b - y) ** 2) ** 0.5 / v)
print(m)


from math import sqrt
(a, b) = map(float, input().strip().split())
n = int(input().strip())
t = 10 ** 25
for i in range(n):
	(x, y, v) = map(float, input().strip().split())
	dist = sqrt((x - a) ** 2 + (y - b) ** 2)
	t = min(t, dist / v)
print(t)


import math
(a, b) = map(int, input().split())
n = int(input())
t = []
for i in range(n):
	(x, y, v) = map(int, input().split())
	d = math.sqrt((x - a) * (x - a) + (y - b) * (y - b))
	t1 = d / v
	t.append(t1)
print(min(t))


import math
(a, b) = map(int, input().split())
k = 100000
dis = 0
for _ in range(int(input())):
	(x, y, v) = map(int, input().split())
	dis = math.sqrt(pow(x - a, 2) + pow(y - b, 2)) / v
	if dis < k:
		k = dis
print(k)


(x, y) = map(int, input().split())
print(min(((lambda u, v, w: ((x - u) ** 2 + (y - v) ** 2) ** 0.5 / w)(*map(int, input().split())) for i in range(int(input())))))


vas = input().split()
vasx = int(vas[0])
vasy = int(vas[1])
n = int(input())
mas = []
for i in range(n):
	x = input().split()
	mas.append(x)
min_len = ((int(mas[0][0]) - vasx) ** 2 + (int(mas[0][1]) - vasy) ** 2) ** 0.5
speed = int(mas[0][2])
T = min_len / speed
for i in range(1, n):
	leng = ((int(mas[i][0]) - vasx) ** 2 + (int(mas[i][1]) - vasy) ** 2) ** 0.5
	t = leng / int(mas[i][2])
	if t < T:
		T = t
print(T)


from math import hypot
(x, y) = map(int, input().split())
min = 10000000000.0
t = int(input())
for _ in range(t):
	(a, b, v) = map(int, input().split())
	if hypot(x - a, y - b) / v < min:
		min = hypot(x - a, y - b) / v
print('%.20f' % min)


import math
(a, b) = list(map(int, input().split()))
n = int(input())
(x, y, v) = list(map(int, input().split()))
mn = math.sqrt((x - a) * (x - a) + (y - b) * (y - b)) / v
for i in range(n - 1):
	(x, y, v) = list(map(int, input().split()))
	t = math.sqrt((x - a) * (x - a) + (y - b) * (y - b)) / v
	if t < mn:
		mn = t
print(mn)


from sys import stdin
from math import hypot
(a, b) = map(int, stdin.readline().split())
n = int(stdin.readline())
result = float('inf')
for _ in range(n):
	(x, y, v) = map(int, stdin.readline().split())
	distance = hypot(a - x, b - y)
	time = distance / v
	result = min(result, time)
print(result)


import math
(a, b) = [int(i) for i in input().split()]
minn = 99999999999999999999
for i in range(int(input())):
	x = [int(i) for i in input().split()]
	y = math.sqrt((a - x[0]) ** 2 + (b - x[1]) ** 2)
	y /= x[2]
	if y < minn:
		minn = y
print(minn)


(a, b) = input().split()
a = int(a)
b = int(b)
n = int(input())
d = []
for i in range(n):
	(x, y, v) = input().split()
	x = int(x)
	y = int(y)
	v = int(v)
	z = ((a - x) ** 2 + (b - y) ** 2) ** 0.5 / v
	d.append(z)
d.sort()
print(d[0])


import math
(x, y) = map(int, input().split(' '))
n = int(input())
res = 2000000000.0
for i in range(n):
	(xi, yi, v) = map(int, input().split(' '))
	res = min(res, math.hypot(x - xi, y - yi) / v)
print(round(res, 9))


def f(x, y, v):
	return ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v
(a, b) = map(int, input().split())
n = int(input())
s = [None] * n
for i in range(n):
	(x, y, v) = map(int, input().split())
	s[i] = f(x, y, v)
print(min(s))


(a, b) = map(int, input().split())
n = int(input())
ans = 100000000
for i in range(n):
	(x, y, v) = map(int, input().split())
	d = ((x - a) ** 2 + (y - b) ** 2) ** 0.5
	ans = min(ans, d * 1.0 / v)
print(ans)


import sys
import math
(a, b) = map(int, input().split())
n = int(input())
m = sys.maxsize
for i in range(n):
	(x, y, v) = map(int, input().split())
	t = math.sqrt(math.pow(x - a, 2) + math.pow(y - b, 2)) / v
	if t < m:
		m = t
print(m)


from math import sqrt
(x, y) = map(int, input().split())
r = int(1000000000.0)
for _ in range(int(input())):
	(a, b, v) = map(int, input().split())
	r = min(r, sqrt((x - a) ** 2 + (y - b) ** 2) / v)
print(r)


import decimal
D = decimal.Decimal
home = [int(x) for x in input().split()]
(xhome, yhome) = (home[0], home[1])
t = int(input())
for x in range(t):
	l1 = [int(x) for x in input().split()]
	if x == 0:
		ans = D(D(((l1[0] - xhome) ** 2 + (l1[1] - yhome) ** 2) ** (1 / 2)) / l1[2])
	ans = min(D(D(((l1[0] - xhome) ** 2 + (l1[1] - yhome) ** 2) ** (1 / 2)) / l1[2]), D(ans))
print(ans)


import math
(a, b) = [int(i) for i in input().split()]
n = int(input())
ans = -1
for i in range(n):
	(x, y, v) = [int(i) for i in input().split()]
	num1 = a - x
	num2 = b - y
	time = math.sqrt(num1 * num1 + num2 * num2)
	time /= v
	if ans != -1 and ans > time:
		ans = time
	elif ans == -1:
		ans = time
print(ans)


import math

def dstnc(fx, fy, sx, sy):
	distance = float(math.sqrt((fx - sx) ** 2 + (fy - sy) ** 2))
	return distance
r = 10000000000000000000000000
(a, b) = map(int, input().split())
n = int(input())
for i in range(n):
	(x, y, v) = map(int, input().split())
	c = dstnc(a, b, x, y)
	t = float(c / v)
	r = min(r, t)
print(r)


import sys
(x, y) = list(map(int, input().strip().split(' ')))
n = int(input())
minimum = sys.maxsize
for i in range(n):
	(a, b, v) = list(map(int, input().strip().split(' ')))
	distance = ((a - x) ** 2 + (b - y) ** 2) ** 0.5
	time = distance / v
	minimum = min(minimum, time)
print('%.20f' % minimum)


(a, b) = map(int, input().split())
m = 1000000000.0
for _ in range(int(input())):
	(x, y, v) = map(int, input().split())
	m = min(m, ((x - a) ** 2 + (y - b) ** 2) ** (1 / 2) / v)
print(m)


(a, b) = map(int, input().split())
n = int(input())
X = [list(map(int, input().split())) for i in range(n)]
minT = 10 ** 6
for i in range(n):
	t = ((X[i][0] - a) ** 2 + (X[i][1] - b) ** 2) ** 0.5 / X[i][2]
	if t < minT:
		minT = t
print(minT)


(x, y) = map(int, input().split())
n = int(input())
s = 10000000000000000000
for i in range(n):
	(a, b, v) = map(int, input().split())
	c = ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v
	if s > c:
		s = c
print('%.10f' % s)


import math
string = input()
numbers = string.split(' ')
a = int(numbers[0])
b = int(numbers[1])
cars = int(input())
times = []
for x in range(cars):
	string = input()
	numbers = string.split(' ')
	x = int(numbers[0])
	y = int(numbers[1])
	v = int(numbers[2])
	distance = math.sqrt(abs(x - a) ** 2 + abs(y - b) ** 2)
	times.append(distance / v)
print(min(times))


(a, b) = map(int, input().strip().split())
minTime = 9999999999999
for _ in range(int(input().strip())):
	(x, y, v) = map(int, input().strip().split())
	dist = ((y - b) ** 2 + (x - a) ** 2) ** 0.5
	time = dist / v
	minTime = min(minTime, time)
print('{0:.7f}'.format(minTime))


(a, b) = map(int, input().split())
n = int(input())
ans = 5000
for i in range(n):
	(x, y, v) = map(int, input().split())
	t = (abs(a - x) * abs(a - x) + abs(b - y) ** 2) ** 0.5
	t = t / v
	if t < ans:
		ans = t
print(ans)


import math
(a, b) = map(int, input().split())
n = int(input())
x = []
y = []
v = []
for _ in range(n):
	(x_, y_, v_) = map(int, input().split())
	x.append(x_)
	y.append(y_)
	v.append(v_)
ans = float('inf')
for i in range(n):
	t = math.sqrt((a - x[i]) * (a - x[i]) + (b - y[i]) * (b - y[i])) / v[i]
	ans = min(ans, t)
print(ans)


(x, y) = map(int, input().split())
n = int(input())
a = list(map(int, input().split()))
m = (abs(a[0] - x) ** 2 + abs(a[1] - y) ** 2) ** 0.5 / a[2]
for i in range(n - 1):
	a = list(map(int, input().split()))
	m = min(m, (abs(a[0] - x) ** 2 + abs(a[1] - y) ** 2) ** 0.5 / a[2])
print(m)


import sys
import math

def read_data():
	(home_x, home_y) = map(int, next(sys.stdin).split())
	n = int(next(sys.stdin))
	taxis = []
	for i in range(n):
		(x, y, v) = map(int, next(sys.stdin).split())
		taxis.append((x, y, v))
	return ((home_x, home_y), taxis)

def distance(p0, p1):
	return math.sqrt((p0[0] - p1[0]) ** 2 + (p0[1] - p1[1]) ** 2)

def solve(home, taxis):
	best_time = None
	for (x, y, v) in taxis:
		time = distance((x, y), home) / v
		if best_time is None or time < best_time:
			best_time = time
	return best_time
(home, taxis) = read_data()
time = solve(home, taxis)
print('{0:.7f}'.format(time))


import math
(x, y) = map(int, input().split())
list = []
for i in range(int(input())):
	(l, r, v) = map(int, input().split())
	list.append(math.sqrt(math.pow(l - x, 2) + math.pow(r - y, 2)) / v)
print(min(list))


from math import sqrt
(x, y) = map(int, input().split())
n = int(input())
t = 10 ** 9
for i in range(n):
	(j, k, v) = map(int, input().split())
	d = sqrt((x - j) ** 2 + (y - k) ** 2) / v
	t = min(t, d)
print(t)


import math
(a, b) = map(int, input().split())
n = int(input())
ans = 1000000000
for i in range(0, n):
	(x, y, v) = map(int, input().split())
	ans = min(ans, math.sqrt((a - x) ** 2 + (b - y) ** 2) / v)
print(ans)


import math
f = input().split()
(a, b) = (int(f[0]), int(f[1]))
n = int(input())
(xi, yi, tm) = ([], [], 0)
for i in range(n):
	f = input().split()
	t = math.sqrt((a - int(f[0])) * (a - int(f[0])) + (b - int(f[1])) * (b - int(f[1]))) / int(f[2])
	if i == 0 or t < tm:
		tm = t
print(tm)


(a, b) = map(int, input().split())
n = int(input())
array = []
for _ in range(n):
	array.append(list(map(int, input().split())))

def dist(x1, y1, x2, y2):
	return pow(pow(x1 - x2, 2) + pow(y1 - y2, 2), 0.5)
lower = dist(a, b, array[0][0], array[0][1]) / array[0][2]
for i in range(1, n):
	t = dist(a, b, array[i][0], array[i][1]) / array[i][2]
	if t < lower:
		lower = t
print(lower)


import math as m
w = 10 ** 6
(a, b) = map(int, input().split())
for _ in range(int(input())):
	(z, x, c) = map(int, input().split())
	s = (z - a) ** 2 + (x - b) ** 2
	q = m.sqrt(s) / c
	w = min(q, w)
print(w)


from math import sqrt
coords = [int(i) for i in input().strip().split(' ')]
n = int(input().strip())
taxi_coords = []
for i in range(n):
	taxi_coords.append([int(j) for j in input().strip().split(' ')])
my_min = sqrt((coords[0] - taxi_coords[0][0]) ** 2 + (coords[1] - taxi_coords[0][1]) ** 2) / taxi_coords[0][2]
for taxi in taxi_coords:
	distance = sqrt((coords[0] - taxi[0]) ** 2 + (coords[1] - taxi[1]) ** 2) / taxi[2]
	if distance < my_min:
		my_min = distance
print(my_min)


from math import *
(a, b) = map(int, input().split())
n = int(input())
m = 10 ** 10
for u in range(n):
	(x, y, v) = map(int, input().split())
	d = sqrt((x - a) ** 2 + (y - b) ** 2)
	z = d / v
	if z < m:
		m = z
print(m)


import math
ab = list(map(int, input().split()))
n = int(input())
pointd = []
for i in range(0, n):
	cabd = list(map(int, input().split()))
	pointd.append(cabd)
cabd = []
for i in range(0, len(pointd)):
	d = (pointd[i][0] - ab[0]) ** 2 + (pointd[i][1] - ab[1]) ** 2
	d = math.sqrt(d)
	c = d / pointd[i][2]
	cabd.append(c)
cabd.sort()
print(cabd[0])


from collections import deque
from math import ceil, floor, sqrt, gcd

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def si():
	return input()
(a, b) = mi()
s = 100000.0
for i in range(ii()):
	(x, y, v) = mi()
	s1 = (x - a) ** 2 + (y - b) ** 2
	s1 = sqrt(s1)
	s1 /= v
	s = min(s, s1)
print('%0.8f' % s)


from math import *

def time_to_vas(x, y, v):
	dist = sqrt((x - xv) ** 2 + (y - yv) ** 2)
	time = dist / v
	return time
(xv, yv) = map(float, input().split())
n = int(input())
min_time = 10 ** 12
for i in range(n):
	(xtax, ytax, vtax) = map(float, input().split())
	time = time_to_vas(xtax, ytax, vtax)
	if time < min_time:
		min_time = time
print(min_time)


import sys
import math
(a, b) = map(int, input().split())
n = int(input())
time = 10000000
for i in range(n):
	arr = list(map(int, input().split()))
	x = arr[0]
	y = arr[1]
	v = arr[2]
	distance = math.sqrt((x - a) * (x - a) + (y - b) * (y - b))
	if distance * (1 / v) < time:
		time = distance * (1 / v)
print(time)


(a, b) = map(int, input().split())
n = int(input())
min = 999999999999999
for i in range(n):
	(x, y, v) = map(int, input().split())
	d = (x - a) * (x - a) + (y - b) * (y - b)
	if d / (v * v) < min:
		min = d / (v * v)
print(min ** 0.5)


(a, b) = map(int, input().split())
n = int(input())
t = float('inf')
for i in range(n):
	(x, y, v) = map(int, input().split())
	if x == a:
		t = min(t, abs(b - y) / v)
	elif y == b:
		t = min(t, abs(a - x) / v)
	else:
		t = min(t, (abs(b - y) ** 2 + abs(a - x) ** 2) ** 0.5 / v)
print(t)


(a, b) = list(map(int, input().split()))
n = int(input())
cars = []
min_t = None
for i in range(n):
	(x, y, v) = list(map(int, input().split()))
	l = ((a - x) ** 2 + (b - y) ** 2) ** 0.5
	t = l / v
	if min_t == None or t < min_t:
		min_t = t
print(min_t)


(x, y) = map(int, input().split())
tmp = float('inf')
for i in range(int(input())):
	(a, b, v) = map(int, input().split())
	tmp = min(tmp, ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v)
print(round(tmp, 9))


number = str(input())
data = number.split()
x = int(data[0])
y = int(data[1])
import math
list1 = []
for number in range(int(input())):
	list1.append(str(input()))
list3 = []
for string in list1:
	list2 = []
	data = string.split()
	X = int(data[0])
	Y = int(data[1])
	V = int(data[2])
	Distance = (X - x) * (X - x) + (Y - y) * (Y - y)
	Distance = float(math.sqrt(Distance))
	time = float(Distance / V)
	list3.append(time)
print(min(list3))


s = input().split()
x0 = int(s[0])
y0 = int(s[1])
n = int(input())
ans = 1000000000

def get_time(x, y, v):
	global x0, y0
	dist_sqr = (x0 - x) ** 2 + (y0 - y) ** 2
	v_sqr = v ** 2
	delta = 500.0
	res = 0.0
	while delta > 1e-07:
		if res ** 2 * v_sqr < dist_sqr:
			res += delta
		elif res ** 2 * v_sqr > dist_sqr:
			res -= delta
		delta /= 2
	return res
for i in range(n):
	s = input().split()
	x = int(s[0])
	y = int(s[1])
	v = int(s[2])
	ans = min(ans, get_time(x, y, v))
print(ans)


(a, b) = map(int, input().split())
from math import sqrt
n = int(input())
ans = 10 ** 9
for _ in range(n):
	(x, y, v) = map(int, input().split())
	time = sqrt((a - x) ** 2 + (b - y) ** 2) / v
	ans = min(ans, time)
print(ans)


(vx, vy) = map(int, input().strip().split())
n = int(input().strip())
t = float('+inf')
for _ in range(n):
	(x, y, v) = map(int, input().strip().split())
	t = min(t, ((vx - x) ** 2 + (vy - y) ** 2) ** 0.5 / v)
print(t)


import math
(a, b) = map(int, input().split())
n = int(input())

def calc(x, y, v):
	res = (x - a) * (x - a) + (y - b) * (y - b)
	return math.sqrt(res) / v
ans = 0
for i in range(n):
	(x, y, v) = map(int, input().split())
	res = calc(x, y, v)
	if not i:
		ans = res
	else:
		ans = min(ans, res)
print(ans)


import math
(a, b) = map(int, input().split())
dis = []
for _ in range(int(input())):
	(x, y, v) = map(int, input().split())
	dis.append(math.sqrt(pow(x - a, 2) + pow(y - b, 2)) / v)
print(min(dis))


import math
(a, b) = map(int, input().split())
n = int(input())
k = []
s = []
for i in range(n):
	(x, y, v) = map(int, input().split())
	k.append([x, y])
	s.append(v)
minn = 10 ** 6
for i in range(n):
	x1 = k[i][0]
	y1 = k[i][1]
	r = math.sqrt(abs(x1 - a) ** 2 + abs(y1 - b) ** 2)
	if r / s[i] < minn:
		minn = r / s[i]
print(minn)


(x, y) = map(int, input().split())
n = int(input())
op = 10000.0
for i in range(n):
	(a, b, v) = map(int, input().split())
	d = ((a - x) ** 2 + (b - y) ** 2) ** 0.5
	if i == 1:
		op = d / v
	elif op > d / v:
		op = d / v
print('%.20f' % op)


from math import sqrt
(x, y) = [int(i) for i in input().split()]
car = int(input())
a = [[int(i) for i in input().split()] for j in range(car)]
minimum = 9999999999999
for i in a:
	if sqrt((i[0] - x) ** 2 + (i[1] - y) ** 2) / i[2] < minimum:
		minimum = sqrt((i[0] - x) ** 2 + (i[1] - y) ** 2) / i[2]
print(minimum)


(a, b) = [int(i) for i in input().split()]
n = int(input())
minTime = None
for i in range(n):
	(x, y, v) = [int(i) for i in input().split()]
	d = pow(pow(a - x, 2) + pow(b - y, 2), 0.5)
	t = d / v
	if minTime is None or t < minTime:
		minTime = t
print(minTime)


(a, b) = map(int, input().split())
n = int(input())
ar = []
for _ in range(n):
	(x, y, z) = map(int, input().split())
	ar.append((abs(x - a) ** 2 + abs(y - b) ** 2) ** 0.5 / z)
print('{:.15f}'.format(min(ar)))


import math, sys

def solve():
	(bx, by) = map(int, input().split())
	dist = lambda f1, f2, v: math.sqrt(f1 * f1 + f2 * f2) / v
	n = int(input())
	ans = sys.maxsize
	for _ in range(n):
		(x, y, v) = map(int, input().split())
		ans = min(ans, dist(x - bx, y - by, v))
	return ans
print(solve())


from math import sqrt
from decimal import Decimal
t = input
p = print
r = range
(a, b) = map(int, t().split())
n = int(t())
ans = float('inf')
for i in range(n):
	(x, y, v) = map(int, t().split())
	dist = Decimal(sqrt((x - a) ** 2 + (y - b) ** 2)) / v
	ans = min(ans, dist)
p('%.20f' % Decimal(ans))


[a, b] = map(int, input().split(' '))
n = int(input())
min_time = -1

def get_time(a, b, x, y, v):
	return ((y - b) ** 2 + (x - a) ** 2) ** 0.5 / v
for i in range(n):
	[x, y, v] = map(int, input().split(' '))
	t = get_time(a, b, x, y, v)
	if min_time == -1 or t < min_time:
		min_time = t
print(min_time)


cood = input()
cood = cood.split(' ')
cood = [int(x) for x in cood]
w = input()
times = []
for x in range(int(w)):
	t = input()
	t = t.split(' ')
	t = [int(x) for x in t]
	dist = (cood[0] - t[0]) ** 2
	dist += (cood[1] - t[1]) ** 2
	dist = dist ** 0.5
	time = dist / t[2]
	times.append(time)
times.sort()
print(times[0])


r = lambda : map(int, input().split())
(a, b) = r()
f = 9000000000.0
for i in [0] * next(r()):
	(x, y, v) = r()
	f = min(f, ((a - x) ** 2 + (b - y) ** 2) ** 0.5 / v)
print(f)


loc = list(map(float, input().split()))
loc_lis = [input().split() for i in range(int(input()))]
print(min(((abs(loc[0] - float(i[0])) ** 2 + abs(loc[1] - float(i[1])) ** 2) ** 0.5 / float(i[2]) for i in loc_lis)))


import math
(a, b) = input().split()
a = int(a)
b = int(b)
n = input()
n = int(n)
min = 999999999999999999999999999999999999999999
for i in range(n):
	(x, y, z) = input().split()
	x = float(x)
	y = float(y)
	z = float(z)
	d = math.sqrt((a - x) ** 2 + (b - y) ** 2) / z
	if d < min:
		min = d
print(min)


(a, b) = list(map(int, input().split()))
t = []
import math
for k in range(int(input())):
	(x, y, v) = list(map(int, input().split()))
	t.append(math.sqrt(abs(a - x) ** 2 + abs(b - y) ** 2) / v)
print('%.20f' % min(t))


(a, b) = map(int, input().split())
n = int(input())
ans = 10.0 ** 19
import math
for _ in range(n):
	(x, y, v) = map(int, input().split())
	d = math.sqrt((x - a) ** 2 + (y - b) ** 2)
	ans = min(ans, d / v)
print(ans)


import math

def dist(a, b, x, y):
	return math.sqrt((a - x) ** 2 + (b - y) ** 2)
(a, b) = map(int, input().split())
n = int(input())
time = 10000000
for i in range(n):
	(x, y, v) = map(int, input().split())
	if dist(a, b, x, y) / v < time:
		time = dist(a, b, x, y) / v
print(time)


import math

def foo():
	(x, y, v) = [int(i) for i in input().split()]
	return math.hypot(x - a, y - b) / v
(a, b) = [int(i) for i in input().split()]
n = int(input())
print(min(map(lambda _: foo(), range(n))))


import math
Tmin = 10000
(x, y) = map(int, input().split())
for _ in range(int(input())):
	(X, Y, S) = map(int, input().split())
	t = math.sqrt((x - X) ** 2 + (y - Y) ** 2) / S
	Tmin = min(Tmin, t)
print(Tmin)


(a, b) = map(int, input().split())
n = int(input())
(x, y, v) = map(int, input().split())
mn = (abs(a - x) ** 2 + abs(b - y) ** 2) ** 0.5 / v
for i in range(n - 1):
	(x, y, v) = map(int, input().split())
	mn = min((abs(a - x) ** 2 + abs(b - y) ** 2) ** 0.5 / v, mn)
print(mn)


from math import hypot, fabs, inf
(x, y) = map(int, input().split())
qnt = int(input())
best = inf
for i in range(qnt):
	(xx, yy, v) = map(int, input().split())
	dist = hypot(fabs(xx - x), fabs(yy - y))
	time = dist / v
	best = min(best, time)
print(best)


from math import sqrt

def distance(x, y):
	return sqrt((x[0] - y[0]) * (x[0] - y[0]) + (x[1] - y[1]) * (x[1] - y[1]))

def taxi(init, lst):
	time = 1000 ** 3
	for elem in lst:
		time = min(time, distance(init, elem) / elem[2])
	return '{0:.20f}'.format(time)
(a, b) = [int(i) for i in input().split()]
n = int(input())
z = list()
for i in range(n):
	(x, y, v) = [int(i) for i in input().split()]
	z.append([x, y, v])
print(taxi([a, b], z))


import math
(a, b) = [int(x) for x in input().split()]
n = int(input())
z = 80000
for i in range(n):
	(p, q, r) = [int(x) for x in input().split()]
	t = (p - a) ** 2 + (q - b) ** 2
	t = t / (r * r)
	if t < z:
		z = t
print(math.sqrt(z))


(x, y) = map(int, input().split())
n = int(input())
t = 10 ** 7
for i in range(n):
	(k, m, l) = map(int, input().split())
	t = min(t, ((x - k) ** 2 + (y - m) ** 2) ** 0.5 / l)
print(t)


(a, b) = map(int, input().split())
n = int(input())
t = 0
for i in range(n):
	(x, y, v) = map(int, input().split())
	t1 = ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v
	if i == 0 or t1 < t:
		t = t1
print(round(t, 7))


import math
list1 = []
(a, b) = map(int, input().split())
n = int(input())
for i in range(n):
	(x, y, v) = map(int, input().split())
	t = math.sqrt((x - a) ** 2 + (b - y) ** 2) / v
	list1.append(t)
print(min(list1))


from math import sqrt
(a, b) = map(int, input().split())
n = int(input())
m = []
for test in range(n):
	(x, y, v) = map(int, input().split())
	time = sqrt((x - a) ** 2 + (y - b) ** 2) / v
	m.append(time)
print(min(m))


(a, b) = map(int, input().split())
n = int(input())
m = []
for i in range(n):
	(x, y, v) = map(int, input().split())
	m.append(((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v)
print(round(min(m), 6))


(a, b) = map(float, input().split())
d = 1000000000000
for i in range(int(input())):
	(x, y, v) = map(float, input().split())
	(A, B) = (abs(y - b), abs(x - a))
	C = (A * A + B * B) ** 0.5
	d = min(d, C / v)
print(d)


(x, y) = input().split()
(x, y) = (int(x), int(y))
n = int(input())
min1 = 10000
for i in range(n):
	(x2, y2, v2) = input().split()
	(x2, y2, v2) = (int(x2), int(y2), int(v2))
	import math
	r = math.sqrt((x - x2) ** 2 + (y - y2) ** 2) / v2
	min1 = min(r, min1)
print('%.19f' % min1)


(a, b) = map(int, input().split())
n = int(input())
answer = 100000000
for i in range(n):
	(x, y, v) = map(int, input().split())
	time = ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v
	answer = min(answer, time)
print(answer)


def solve(arr, a, b):
	res = []
	for i in arr:
		x = ((b - i[1]) ** 2 + (a - i[0]) ** 2) ** 0.5
		t = round(x / i[2], 6)
		res.append(t)
	return min(res)

def main():
	(a, b) = list(map(int, input().split(' ')))
	n = int(input())
	arr = []
	for _ in range(n):
		i = list(map(int, input().split(' ')))
		arr.append(i)
	print(solve(arr, a, b))
main()


import math
(a, b) = map(int, input().split())
n = int(input())
ans = 1000
for _ in range(n):
	(x, y, v) = map(int, input().split())
	ans = min(ans, math.sqrt(pow(x - a, 2) + pow(y - b, 2)) / v)
print(ans)


(a, b) = map(int, input().split())
n = int(input())
mint = (200 ** 2 * 2) ** 0.5
for _ in range(n):
	(x, y, v) = map(int, input().split())
	t = ((a - x) ** 2 + (b - y) ** 2) ** 0.5 / v
	mint = min(mint, t)
print(mint)


from math import sqrt

def sqr(a):
	return a * a

def distance(x1, y1, x2, y2):
	return sqrt(sqr(y2 - y1) + sqr(x2 - x1))
(a, b) = map(int, input().split(' '))
n = int(input())
times = []
for i in range(n):
	point = input().split(' ')
	point = list(map(int, point))
	times.append(round(distance(a, b, point[0], point[1]) / point[2], 10))
print(min(times))


import sys
import math
(a, b) = [int(x) for x in input().split()]
n = int(input())
m = sys.float_info.max
while n > 0:
	n -= 1
	(x, y, v) = [int(x) for x in input().split()]
	m = min(math.sqrt((a - x) ** 2 + (b - y) ** 2) / v, m)
print(m)


def S(x1, y1, x2, y2):
	return ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5
(a, b) = map(int, input().split())
mas = []
for i in range(int(input())):
	(x, y, v) = map(int, input().split())
	mas.append(S(a, b, x, y) / v)
print(min(mas))


import math
(a, b) = map(int, input().split())
n = int(input())
ans = []

def dis(x, y, a, b):
	return math.sqrt((x - a) ** 2 + (y - b) ** 2)
for i in range(n):
	(x, y, v) = map(int, input().split())
	ans.append(dis(x, y, a, b) / v)
print(min(ans))


from math import sqrt
(a, b) = map(int, input().split())
n = int(input())
ans = 10 ** 20
for i in range(n):
	(x, y, v) = map(int, input().split())
	ans = min(ans, sqrt((x - a) ** 2 + (y - b) ** 2) / v)
print('%.10f' % ans)


(x, y) = map(int, input().split())
mi = 999999999999
for i in range(int(input())):
	(a, b, c) = map(int, input().split())
	t = ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / c
	if t < mi:
		mi = t
print(round(mi, 20))


import math
c = input().split()
(x1, y1) = (int(c[0]), int(c[1]))
n = int(input())
d = []
for i in range(n):
	c = [int(i) for i in input().split()]
	distance = math.sqrt((c[0] - x1) ** 2 + (c[1] - y1) ** 2) / c[2]
	d.append(distance)
print(min(d))


(x, y) = map(int, input().split())
n = int(input())
(a, b, v) = map(int, input().split())
t = pow((x - a) ** 2 + (y - b) ** 2, 1 / 2) / v
for i in range(n - 1):
	(a, b, v) = map(int, input().split())
	if pow((x - a) ** 2 + (y - b) ** 2, 1 / 2) / v < t:
		t = pow((x - a) ** 2 + (y - b) ** 2, 1 / 2) / v
print('{:.20f}'.format(t))


from math import sqrt
[a, b] = list(map(float, input().split()))
n = int(input())
[x, y, v] = list(map(float, input().split()))
tmin = sqrt((x - a) ** 2 + (y - b) ** 2) / v
for i in range(1, n):
	[x, y, v] = list(map(float, input().split()))
	t = sqrt((x - a) ** 2 + (y - b) ** 2) / v
	if t < tmin:
		tmin = t
print(tmin)


(a, b) = map(int, input().split())
n = int(input())
xyvi = [list(map(int, input().split())) for i in range(n)]
xyvi2 = [((a - xyvi[i][0]) ** 2 + (b - xyvi[i][1]) ** 2) ** 0.5 / xyvi[i][2] for i in range(n)]
print(min(xyvi2))


import math
(x, y) = map(int, input().split())
n = input()
n = int(n)
m = float('inf')
for i in range(0, n):
	(a, b, c) = map(int, input().split())
	t = math.sqrt((a - x) * (a - x) + (b - y) * (b - y)) / c
	if m > t:
		m = t
print(m)


import math
(a, b) = [int(i) for i in input().split()]
n = int(input())
(x, y, v) = [int(i) for i in input().split()]
res = math.sqrt((x - a) ** 2 + (y - b) ** 2) / v
for i in range(n - 1):
	(x, y, v) = [int(i) for i in input().split()]
	t = math.sqrt((x - a) ** 2 + (y - b) ** 2) / v
	if t < res:
		res = t
print(res)


import math
(a, b) = str(input()).split()
a = int(a)
b = int(b)
n = int(input())
line = list()
for i in range(n):
	(x, y, v) = str(input()).split()
	x = int(x)
	y = int(y)
	v = int(v)
	line.append(math.sqrt((a - x) * (a - x) + (b - y) * (b - y)) / v)
print(min(line))


from math import sqrt
(a, b) = map(int, input().split())
n = int(input())
c = []
ans = 10000000
for i in range(n):
	(x, y, v) = map(int, input().split())
	square = (a - x) * (a - x) + (b - y) * (b - y)
	square = sqrt(square)
	time = square / v
	ans = min(ans, time)
print(ans)


read = lambda : map(int, input().split())
(a, b) = read()
n = int(input())
ans = float('inf')
from math import hypot
for i in range(n):
	(x, y, v) = read()
	cur = hypot(x - a, y - b) / v
	ans = min(ans, cur)
print(ans)


import math
st = [int(i) for i in input().split(' ')]
a = st[0]
b = st[1]
t = []
n = int(input())
for i in range(n):
	st1 = [int(i) for i in input().split(' ')]
	a1 = st1[0]
	b1 = st1[1]
	v = st1[2]
	s = math.sqrt((a1 - a) ** 2 + (b1 - b) ** 2)
	t.append(s / v)
print(min(t))


from math import sqrt

def dist(a, b, x, y):
	return sqrt((a - x) * (a - x) + (b - y) * (b - y))
[a, b] = [int(x) for x in input().split()]
n = int(input())
ans = 100000
for i in range(n):
	[x, y, v] = [int(x) for x in input().split()]
	ans = min(ans, dist(a, b, x, y) / v)
print(ans)


mas = list(map(int, input().split()))
x0 = mas[0]
y0 = mas[1]
mas = list(map(int, input().split()))
t = mas[0]
tmin = 9999999999999999999999999999
for j in range(t):
	mas = list(map(int, input().split()))
	xi = mas[0]
	yi = mas[1]
	vi = mas[2]
	tmin = min(tmin, ((xi - x0) ** 2 + (yi - y0) ** 2) ** 0.5 / vi)
print(tmin)


(a, b) = input().split()
(a, b) = (int(a), int(b))
n = int(input())
Min = 100000
for i in range(0, n):
	(x, y, v) = input().split()
	Speed = (abs(int(x) - a) ** 2 + abs(int(y) - b) ** 2) ** 0.5 / int(v)
	if Speed < Min:
		Min = Speed
print(Min)


import math
orig = input().split(' ')
a = int(orig[0])
b = int(orig[1])
taxis = int(input())
mintime = 100000
for c in range(taxis):
	raw = input().split(' ')
	x = int(raw[0])
	y = int(raw[1])
	v = int(raw[2])
	loctime = math.sqrt(pow(x - a, 2) + pow(y - b, 2)) / v
	if loctime < mintime:
		mintime = loctime
print(mintime)


(a, b) = list(map(int, input().split()))
n = int(input())
minT = 1000000000.0
for _ in range(n):
	(x, y, v) = list(map(int, input().split()))
	d = ((a - x) ** 2 + (b - y) ** 2) ** 0.5
	t = d / v
	minT = min(minT, t)
print(minT)


import math
a = input().split()
t = int(input())
ans = 10000000
while t > 0:
	b = input().split()
	d = math.sqrt((int(a[0]) - int(b[0])) * (int(a[0]) - int(b[0])) + (int(a[1]) - int(b[1])) * (int(a[1]) - int(b[1])))
	ans = min(ans, d / int(b[2]))
	t -= 1
print('%.20f' % ans)


def toFixed(numObj, digits=0):
	return f'{numObj:.{digits}f}'

def f(x1, y1, x2, y2):
	if x1 == x2:
		return abs(max(y1, y2) - min(y1, y2))
	elif y1 == y2:
		return abs(max(x1, x2) - min(x1, x2))
	else:
		x = abs(x1 - x2)
		y = abs(y1 - y2)
		return toFixed((x ** 2 + y ** 2) ** 0.5, digits=6)
(a, b) = map(int, input().split())
n = int(input())
s = 0
ans = 10 ** 12
v = 0
for i in range(n):
	l1 = list(map(int, input().split()))
	s = f(l1[0], l1[1], a, b)
	s = float(s) / l1[2]
	ans = min(ans, s)
print(ans)


ins = input().split()
a = int(ins[0])
b = int(ins[1])
n = int(input())
ins = list(map(int, input().split()))
minx = ((ins[0] - a) ** 2 + (ins[1] - b) ** 2) ** (1 / 2) / ins[2]
for i in range(1, n):
	ins = list(map(int, input().split()))
	if ((ins[0] - a) ** 2 + (ins[1] - b) ** 2) ** (1 / 2) / ins[2] < minx:
		minx = ((ins[0] - a) ** 2 + (ins[1] - b) ** 2) ** (1 / 2) / ins[2]
print(minx)


import math
(rs, ri, rai) = (input, lambda : int(input()), lambda : list(map(int, input().split())))
(a, b) = rai()
n = ri()
m = float('inf')
for i in range(n):
	(x, y, v) = rai()
	d = math.sqrt((a - x) ** 2 + (b - y) ** 2)
	m = min(m, d / v)
print(m)


from math import sqrt
(a, b) = list(map(int, input().split()))
n = int(input())
ans = 10000
for i in range(n):
	(x, y, v) = list(map(int, input().split()))
	time = sqrt(abs(a - x) ** 2 + abs(b - y) ** 2) / v
	ans = min(ans, time)
print(ans)


from math import sqrt

def LenOfWay(a, b, x, y):
	if a < x:
		(a, x) = (x, a)
	if b < y:
		(b, y) = (y, b)
	return sqrt((a - x) ** 2 + (b - y) ** 2)
(a, b) = map(int, input().split())
n = int(input())
n -= 1
(x, y, v) = map(int, input().split())
MinTime = LenOfWay(a, b, x, y) / v
while n > 0:
	n -= 1
	(x, y, v) = map(int, input().split())
	tmp = LenOfWay(a, b, x, y) / v
	if tmp < MinTime:
		MinTime = tmp
print(MinTime)


(a, b) = map(int, input().split())
(n, r) = (int(input()), 500.0)
for i in range(n):
	(x, y, v) = map(int, input().split())
	r = min(r, ((a - x) ** 2 + (b - y) ** 2) ** 0.5 / v)
print(r)


(a, b) = [int(s) for s in input().split(' ')]
n = int(input())
m = float('inf')
for taxi in range(n):
	(x, y, v) = [int(s) for s in input().split(' ')]
	m = min(m, ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v)
print(m)


import math
CarPos = []

def LeastTime(x, y, n, CarPos):
	time = []
	for i in range(n):
		for j in range(3):
			dis = math.sqrt((CarPos[i][0] - x) ** 2 + (CarPos[i][1] - y) ** 2)
			t = dis / CarPos[i][2]
			time.append(t)
	return min(time)
(x, y) = [int(a) for a in input().split()]
n = int(input())
CarVal = []
for i in range(n):
	row = [int(a) for a in input().split()]
	CarVal.append(row)
print(LeastTime(x, y, n, CarVal))


(x, y) = map(int, input().split())
n = int(input())
d = []
for i in range(n):
	(x1, y1, v) = map(int, input().split())
	p = (x - x1) ** 2
	q = (y - y1) ** 2
	r = (p + q) ** 0.5
	d.append(r / v)
print(min(d))


(a, b) = [int(x) for x in input().split()]
n = int(input())
r = 1000000000
for _ in range(n):
	(x, y, v) = [int(x) for x in input().split()]
	d = ((a - x) ** 2 + (b - y) ** 2) ** 0.5 / v
	if d < r:
		r = d
print(r)


(a, b) = map(int, input().split())
n = int(input())
cars = []
min_time = 0
done_first = False
for i in range(n):
	(x, y, v) = map(int, input().split())
	x -= a
	y -= b
	if not done_first:
		min_time = (x * x + y * y) ** 0.5 / v
	else:
		min_time = min(min_time, (x * x + y * y) ** 0.5 / v)
	done_first = True
print(min_time)


(a, b) = map(int, input().split())
t = 10 ** 9
n = int(input())
for _ in range(n):
	(x, y, v) = map(int, input().split())
	t = min(((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v, t)
print(t)


(a, b) = [int(i) for i in input().split()]
n = int(input())

def pyth(a, b):
	return (a ** 2 + b ** 2) ** 0.5
taxis = [0] * n
for row in range(n):
	(i, j, v) = [int(i) for i in input().split()]
	d = pyth(i - a, j - b)
	t = d / v
	taxis[row] = t
print(min(taxis))


(a, b) = list(map(int, input().split()))
n = int(input())
(x, y, v) = list(map(int, input().split()))
t = ((a - x) ** 2 + (b - y) ** 2) ** 0.5 / v
for j in range(n - 1):
	(x, y, v) = list(map(int, input().split()))
	t = min(t, ((a - x) ** 2 + (b - y) ** 2) ** 0.5 / v)
print('{0:.10f}'.format(t))


import math
import sys

def calc_dist(x1, x2, y1, y2):
	dist = math.sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2))
	return dist
(a, b) = map(int, input().split())
n = int(input())
time = sys.maxsize
for _ in range(n):
	(x, y, v) = map(int, input().split())
	distance = calc_dist(x, a, y, b)
	time = min(time, distance / v)
print(time)


(a, b) = map(int, input().split())
l = []
for i in range(int(input())):
	(x, y, v) = map(int, input().split())
	d = ((a - x) ** 2 + (b - y) ** 2) ** (1 / 2)
	t = d / v
	l.append('{:.20f}'.format(t))
print(min(l))


import math

def distance(x, y, a, b):
	return math.sqrt((x - a) ** 2 + (y - b) ** 2)
ans = float('inf')
(x, y) = map(int, input().split())
t = int(input())
for _ in range(t):
	(a, b, s) = map(int, input().split())
	an = distance(x, y, a, b) / s
	if an < ans:
		ans = an
print(ans)


from math import *
(a, b) = map(int, input().split())
n = int(input())
for i in range(n):
	(x, y, v) = map(int, input().split())
	dist = sqrt((x - a) ** 2 + (y - b) ** 2)
	time = dist / v
	if i == 0:
		ans = time
	elif time < ans:
		ans = time
print(ans)


import math
(x1, y1) = (int(x) for x in input().split())
n = int(input())
t = 10 ** 9 + 7
for _ in range(n):
	(x2, y2, v) = (int(x) for x in input().split())
	if abs(math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)) / v < t:
		t = abs(math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)) / v
print(t)


from math import hypot
(x1, y1) = map(int, input().split())
t = int(input())
m = float('inf')
for i in range(t):
	(x2, y2, speed) = map(int, input().split())
	x = x1 - x2
	y = y1 - y2
	k = hypot(x, y)
	m = min(m, k / speed)
print(m)


import math
time = 10 ** 9
(a, b) = map(int, input().split())
n = int(input())
for i in range(n):
	(x, y, v) = map(int, input().split())
	d = math.sqrt((a - x) ** 2 + (b - y) ** 2)
	temp = d / v
	if time > temp:
		time = temp
print(time)


from math import sqrt
(a, b) = map(int, input().split())
n = int(input())
mit = 1000000000000000000000000000000000000
for i in range(n):
	(x, y, v) = map(int, input().split())
	if sqrt((x - a) ** 2 + (y - b) ** 2) / v < mit:
		mit = sqrt((x - a) ** 2 + (y - b) ** 2) / v
print(mit)


(a, b) = map(int, input().split())
m = float('inf')
n = int(input())
for _ in range(n):
	(x, y, v) = map(int, input().split())
	dist = ((a - x) ** 2 + (b - y) ** 2) ** 0.5
	m = min(m, dist / v)
print('%.6f' % m)


(a, b) = map(int, input().split())
n = int(input())
c = list()
i = 0
for i in range(n):
	c.append([int(j) for j in input().split()])
import math
x = math.sqrt((c[0][0] - a) ** 2 + (c[0][1] - b) ** 2) / c[0][2]
for i in range(1, n):
	if math.sqrt((c[i][0] - a) ** 2 + (c[i][1] - b) ** 2) / c[i][2] < x:
		x = math.sqrt((c[i][0] - a) ** 2 + (c[i][1] - b) ** 2) / c[i][2]
print(x)


import math as m
(hx, hy) = map(int, input().split())
n = int(input())
res = 1000
for i in range(n):
	(x, y, v) = map(int, input().split())
	res = min(m.sqrt(pow(hx - x, 2) + pow(hy - y, 2)) / v, res)
print(res, end='')


import math
(a, b) = map(int, input().split())
n = int(input())
ans = 1e+18
for _ in range(n):
	(x, y, v) = map(int, input().split())
	dist = math.sqrt((a - x) ** 2 + (b - y) ** 2)
	t = dist / v
	ans = min(ans, t)
print(ans)


from math import sqrt

def timing(a: int, b: int, aa: int, bb: int, v: int) -> float:
	return sqrt((aa - a) ** 2 + (bb - b) ** 2) / v
(a, b) = map(int, input().split())
num = int(input())
min_t = None
for n in range(num):
	(aa, bb, v) = map(int, input().split())
	temp_t = timing(a, b, aa, bb, v)
	if min_t is None:
		min_t = temp_t
	elif temp_t < min_t:
		min_t = temp_t
print(min_t)


s = [int(S) for S in input().split()]
(a, b) = (s[0], s[1])
n = int(input())
x = [int(S) for S in input().split()]
s = ((x[0] - a) ** 2 + (x[1] - b) ** 2) ** 0.5
tmin = s / x[2]
for i in range(1, n):
	x = [int(S) for S in input().split()]
	s = ((x[0] - a) ** 2 + (x[1] - b) ** 2) ** 0.5
	t = s / x[2]
	if tmin > t:
		tmin = t
print(tmin)


def inp():
	return map(int, input().split())
from math import *
(a, b) = inp()
ans = inf
for i in range(int(input())):
	(x, y, v) = inp()
	ans = min(sqrt((x - a) ** 2 + (y - b) ** 2) / v, ans)
print('{:.20f}'.format(ans))


(a, b) = map(int, input().split())
n = int(input())
d = 10 ** 99
for _ in range(n):
	(x, y, v) = map(int, input().split())
	dist = ((x - a) ** 2 + (y - b) ** 2) ** 0.5
	ti = dist / float(v)
	d = min(d, ti)
print(d)


from math import *

def h(m, n):
	return sqrt(n * n + m * m)
(a, b) = map(int, input().split())
c = int(input())
(x, y, z) = map(int, input().split())
fuck = h(x - a, y - b) / z
for i in range(1, c, 1):
	(x, y, z) = map(int, input().split())
	sex = h(x - a, y - b) / z
	fuck = min(fuck, sex)
print('%.9f' % fuck)


(a, b) = list(map(int, input().split()))
n = int(input())
coords = []
times = []
for i in range(n):
	(x, y, v) = list(map(int, input().split()))
	coords = coords + [[x, y, v]]
for i in range(n):
	x = coords[i][0]
	y = coords[i][1]
	v = coords[i][2]
	if a == x and b != y:
		times = times + [abs(y - b) / v]
	elif a != x and b == y:
		times = times + [abs(x - a) / v]
	elif a != x and b != y:
		times = times + [((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v]
	else:
		times = times + [0]
print(min(times))


(a, b) = map(int, input().split(' '))
n = int(input())
import math
X = []

def distance(x, y):
	return math.sqrt((x - a) ** 2 + (y - b) ** 2)
for i in range(n):
	(x, y, s) = map(int, input().split(' '))
	X.append(distance(x, y) / s)
print(min(X))


def get_ints():
	return tuple(map(int, input().split()))

def main():
	(x, y) = get_ints()
	n = int(input())
	r = None
	for _ in range(n):
		(a, b, v) = get_ints()
		t = ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v
		if r is None or r > t:
			r = t
	print(r)
main()


a = [int(x) for x in input().split()]
b = int(input())
cars = []
for i in range(0, b):
	cars.append([int(x) for x in input().split()])
eta = []
for i in range(0, b):
	dx = cars[i][0] - a[0]
	dy = cars[i][1] - a[1]
	mag = (dx ** 2 + dy ** 2) ** 0.5
	eta.append(mag / cars[i][2])
print(min(eta))


import math
(a, b) = [int(i) for i in input().split()]
n = int(input())
min_time = 9999999999
for i in range(n):
	(x, y, v) = [int(a) for a in input().split()]
	dist = math.sqrt((a - x) ** 2 + (b - y) ** 2)
	time = float(dist) / v
	if time < min_time:
		min_time = time
print(min_time)


import math
(a, b) = map(int, input().split())
n = int(input(''))
(xi, yi, vi) = map(int, input().split())
t = math.sqrt((a - xi) * (a - xi) + (b - yi) * (b - yi)) / vi
for i in range(n - 1):
	(xi, yi, vi) = map(int, input().split())
	t_min = math.sqrt((a - xi) * (a - xi) + (b - yi) * (b - yi)) / vi
	if t_min < t:
		t = t_min
t = format(t, '.20f')
print(t)


def dist(a, b, x, y):
	return ((a - x) ** 2 + (b - y) ** 2) ** 0.5
(a, b) = list(map(int, input().split()))
n = int(input())
m = None
for i in range(n):
	(x, y, v) = list(map(int, input().split()))
	t = dist(a, b, x, y) / v
	if m is None or t < m:
		m = t
print(m)


from sys import stdin
from math import sqrt
(x, y) = map(int, stdin.readline().split())
n = int(input())
tempsMin = 1000 * 1000
for i in range(n):
	(xTaxi, yTaxi, vitesse) = map(int, stdin.readline().split())
	distance = sqrt((xTaxi - x) ** 2 + (yTaxi - y) ** 2)
	temps = distance / vitesse
	if temps < tempsMin:
		tempsMin = temps
print(tempsMin)


import os, sys, math
from _thread import start_new_thread

def child(item):
	print('hello from thread number', item)

def parent(i=0):
	while input() != 'exit':
		i += 1
		start_new_thread(child, (i,))
	print('bye')

def main():
	(a, b) = map(int, input().split())
	n = int(input())
	ans = 10.0 ** 10
	for i in range(n):
		(_a, _b, _v) = map(int, input().split())
		_a -= a
		_b -= b
		ans = min(ans, (_a ** 2 + _b ** 2) ** 0.5 / _v)
	print(ans)
sys.exit(int(main() or 0))


(a, b) = map(int, input().split())
n = int(input())
min_time = 1000000000.0
for i in range(n):
	(x, y, v) = map(int, input().split())
	cur_time = ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v
	if cur_time < min_time:
		min_time = cur_time
print(min_time)


import math
(a, b) = map(int, input().split())
n = int(input())
mn = 99999999999999
for i in range(n):
	(x, y, v) = map(int, input().split())
	res = math.sqrt((x - a) ** 2 + (y - b) ** 2)
	res = res / v
	mn = min(mn, res)
print(mn)


from math import *
(a, b) = [int(i) for i in input().split()]
ans = 999999999999
for _ in range(int(input())):
	(x, y, v) = [int(i) for i in input().split()]
	dist = sqrt((x - a) ** 2 + (y - b) ** 2)
	t = dist / v
	ans = min(t, ans)
print('%.8f' % ans)


import math
(A, B) = list(map(int, input().split()))
N = int(input())
m = -1
for i in range(N):
	(x, y, v) = list(map(int, input().split()))
	dist = math.sqrt((A - x) ** 2 + (B - y) ** 2)
	dist /= v
	if m is -1:
		m = dist
	m = min(m, dist)
print(m)


from math import sqrt
ab = list(map(int, input().split()))
time = []
for k in range(int(input())):
	xyv = list(map(int, input().split()))
	temp = sqrt((ab[0] - xyv[0]) ** 2 + (ab[1] - xyv[1]) ** 2)
	time.append(temp / xyv[2])
minimum = time[0]
for i in range(len(time)):
	minimum = min(minimum, time[i])
print(minimum)


from collections import Counter
import string
import math
import sys

def array_int():
	return [int(i) for i in sys.stdin.readline().split()]

def vary(number_of_variables):
	if number_of_variables == 1:
		return int(sys.stdin.readline())
	if number_of_variables >= 2:
		return map(int, sys.stdin.readline().split())

def makedict(var):
	return dict(Counter(var))
mod = 100000007
(x, y) = vary(2)
n = vary(1)
tt = []
for i in range(n):
	(x1, y1, v) = vary(3)
	tt.append(math.pow((x1 - x) ** 2 + (y - y1) ** 2, 1 / 2) / v)
print(min(tt))


import math
(a, b) = map(int, input().split())
n = int(input())
arr = []
for i in range(0, n):
	(x, y, v) = map(int, input().split())
	arr.append(math.sqrt((x - a) ** 2 + (y - b) ** 2) / v)
print('%.20f' % min(arr))


(a, b) = map(int, input().split())
n = int(input())
T = 1000
for i in range(n):
	(c, d, v) = map(int, input().split())
	t = ((c - a) ** 2 + (b - d) ** 2) ** 0.5 / v
	T = min(t, T)
print(T)


import math
(x, y) = map(int, input().split())
n = int(input())
answer = 1000000000.0
for _ in range(n):
	(a, b, c) = map(int, input().split())
	answer = min(answer, math.sqrt((a - x) ** 2 + (b - y) ** 2) / c)
print(answer)


def calculate(s, e, p):
	l = ((s[0] - e[0]) ** 2 + (s[1] - e[1]) ** 2) ** (1 / 2)
	return l / p
start = list(map(int, input().split(' ')))
n = int(input())
t = 10 ** 6
for i in range(n):
	end = list(map(int, input().split(' ')))
	t = min(t, calculate(start, end, end[2]))
print(t)


import math, heapq
from decimal import Decimal

def getTime(x1, y1, x2, y2, v):
	distance = math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2))
	time = distance / v
	return time
co_or = list(map(eval, input().split()))
x1 = co_or[0]
y1 = co_or[1]
helper = []
q = eval(input())
for i in range(q):
	co_or_2 = list(map(eval, input().split()))
	x2 = co_or_2[0]
	y2 = co_or_2[1]
	v = co_or_2[2]
	helper.append(getTime(x1, y1, x2, y2, v))
heapq.heapify(helper)
print(heapq.heappop(helper))


import math as mt
import sys, string, bisect
input = sys.stdin.readline
from collections import deque, defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())

def dist(x, y, c, d):
	return mt.sqrt((x - c) ** 2 + (y - d) ** 2)
(x, y) = M()
n = I()
v = 1000000
pre = len('00000000000000000000')
for i in range(n):
	(c, d, s) = M()
	a = dist(x, y, c, d) / s
	v = min(v, a)
print(round(v, pre))


from math import sqrt, exp
VC = input()
(Vx, Vy) = VC.split()
Vx = float(Vx)
Vy = float(Vy)
avaBT = int(input())
taxi = []
for n in range(avaBT):
	att = input()
	(Bx, By, Bv) = att.split()
	Bx = float(Bx)
	By = float(By)
	Bv = float(Bv)
	t = sqrt((Bx - Vx) ** 2 + (By - Vy) ** 2) / Bv
	taxi.append(t)
print(min(taxi))


import math

def get_primes(prime_supr):
	is_prime = [0] * 2 + [1] * prime_supr
	for i in range(2, int(math.sqrt(prime_supr)) + 1):
		if is_prime[i]:
			for j in range(i * i, prime_supr + 1, i):
				is_prime[j] = 0
	return is_prime
get_int = lambda : map(int, input().split())
(a, b) = get_int()
n = int(input())
t = 1000000.0
for i in range(n):
	(x, y, v) = get_int()
	t = min(t, math.sqrt((x - a) ** 2 + (y - b) ** 2) / v)
print(t)


import math

def distance(x, y):
	return math.sqrt((a - x) ** 2 + (b - y) ** 2)
(a, b) = map(int, input().split())
n = int(input())
car = []
min = 100000000000
for i in range(n):
	car.append(list(map(int, input().split())))
	tmp = distance(car[i][0], car[i][1]) / car[i][2]
	if min > tmp:
		min = tmp
print(min)


from math import sqrt
(a, b) = [int(i) for i in input().split()]
n = int(input())
m = -1
for i in range(n):
	(x, y, v) = [int(i) for i in input().split()]
	t = sqrt(abs(x - a) ** 2 + abs(y - b) ** 2) / v
	if m == -1:
		m = t
	else:
		m = min(m, t)
print(m)


from math import sqrt
(x, y) = map(int, input().split())
M = float('inf')
for i in range(int(input())):
	(u, k, v) = map(int, input().split())
	xx = sqrt((x - u) ** 2 + (y - k) ** 2)
	t = xx / v
	M = min(M, t)
print(M)


from math import sqrt
(a, b) = map(int, input().split())
n = int(input())
best_time = 999999999
for _ in range(n):
	(x, y, v) = map(int, input().split())
	time = sqrt((a - x) ** 2 + (b - y) ** 2) / v
	if time < best_time:
		best_time = time
print(best_time)


import math

def taxi(a, b, taxis):
	mn = math.sqrt((a - int(taxis[0][0])) * (a - int(taxis[0][0])) + (b - int(taxis[0][1])) * (b - int(taxis[0][1]))) / int(taxis[0][2])
	for taxi in taxis:
		x = int(taxi[0])
		y = int(taxi[1])
		v = int(taxi[2])
		mn = min(math.sqrt((a - x) * (a - x) + (b - y) * (b - y)) / v, mn)
	return mn
pos = input()
n = input()
arr = []
for i in range(int(n)):
	[x, y, v] = input().split(' ')
	arr.append([int(x), int(y), int(v)])
[x, y] = pos.split(' ')
print(taxi(int(x), int(y), arr))


(x, y) = map(int, input().split())
n = int(input())
res = 2000000000.0
for i in range(n):
	(xi, yi, v) = map(int, input().split())
	res = min(res, ((x - xi) * (x - xi) + (y - yi) * (y - yi)) ** 0.5 / v)
print(round(res, 9))


import math
[x, y] = [int(x) for x in input().split()]
t = []
n = int(input())
for i in range(n):
	[a, b, c] = [int(x) for x in input().split()]
	if a == x == 0:
		xaxis = 0
	elif int(a) != int(x) and int(a) <= 0 and (int(x) >= 0):
		xaxis = abs(a) + x
	elif int(a) != int(x) and int(a) <= 0 and (int(x) <= 0):
		xaxis = abs(a - x)
	elif int(a) != int(x) and int(a) >= 0 and (int(x) <= 0):
		xaxis = a + abs(x)
	elif int(a) != int(x) and int(a) >= 0 and (int(x) >= 0):
		xaxis = abs(a - x)
	else:
		xaxis = 0
	if b == x == 0:
		yaxis = 0
	elif int(b) != int(y) and int(b) <= 0 and (int(y) >= 0):
		yaxis = abs(b) + y
	elif int(b) != int(y) and int(b) <= 0 and (int(y) <= 0):
		yaxis = abs(b - y)
	elif int(b) != int(y) and int(b) >= 0 and (int(y) <= 0):
		yaxis = b + abs(y)
	elif int(b) != int(y) and int(b) >= 0 and (int(y) >= 0):
		yaxis = abs(b - y)
	else:
		yaxis = 0
	totaltime = math.sqrt(xaxis ** 2 + yaxis ** 2) / c
	t.append(totaltime)
print(min(t))


from math import sqrt
arr = list(map(int, input().strip().split()))
a = arr[0]
b = arr[1]
n = int(input())
arr = []
for i in range(n):
	arr.append(list(map(int, input().strip().split())))
time = 10 ** 10
dist = 0
for i in arr:
	dist = sqrt((i[0] - a) ** 2 + (i[1] - b) ** 2)
	if dist / i[2] < time:
		time = dist / i[2]
print(time)


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
(a, b) = map(int, input().split())
n = int(input())
ans = float('inf')
for i in range(n):
	(x, y, v) = map(int, input().split())
	t = math.sqrt((x - a) ** 2 + (y - b) ** 2) / v
	ans = min(t, ans)
print(ans)


import math
(a, b) = map(float, input().split())
n = int(input())
ans = 1000000.0
for i in range(n):
	(x, y, v) = map(float, input().split())
	ans = min(ans, math.sqrt((a - x) * (a - x) + (b - y) * (b - y)) / v)
print(ans)


import math
(a, b) = map(int, input().split())
n = int(input())
x = [int(x) for x in input().split()]
mn = math.sqrt(pow(a - x[0], 2) + pow(b - x[1], 2)) / x[2]
for i in range(n - 1):
	x = [int(x) for x in input().split()]
	mn = min(mn, math.sqrt(pow(a - x[0], 2) + pow(b - x[1], 2)) / x[2])
print(mn)


(Lives, Least) = (list(map(int, input().split())), 10 ** 9)
for i in range(int(input())):
	Temp = list(map(int, input().split()))
	Least = min(Least, ((Lives[0] - Temp[0]) ** 2 + (Lives[1] - Temp[1]) ** 2) ** 0.5 / Temp[2])
print(Least)


from sys import maxsize
(x, y) = [int(i) for i in input().split()]
res = maxsize
for _ in range(int(input())):
	(a, b, c) = [int(i) for i in input().split()]
	if c != 0:
		res = min(res, ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / c)
	elif a == x and b == y:
		res = 0
print(res)


import math
(a, b) = map(int, input().split())
n = int(input())
ans = 10000000000000000000000000000000000000000000000000
for _ in range(n):
	(x, y, v) = map(int, input().split())
	ans = min(ans, math.pow(math.pow(a - x, 2) + math.pow(b - y, 2), 0.5) / v)
print('{0:.20f}'.format(ans))


from math import sqrt
(a, b) = map(int, input().split())
n = int(input())
ans = []
for i in range(n):
	(x, y, v) = map(int, input().split())
	ans.append(sqrt((a - x) ** 2 + (b - y) ** 2) / v)
print(min(ans))


from math import sqrt
(a, b) = input().split(' ')
(a, b) = (int(a), int(b))
n = int(input())
time = -1
for i in range(n):
	(x, y, v) = input().split(' ')
	(x, y, v) = (int(x), int(y), int(v))
	tempo = sqrt((a - x) ** 2 + (b - y) ** 2) / v
	if tempo < time or time == -1:
		time = tempo
print(time)


(a, b) = map(int, input().split())
n = int(input())
t = []
for i in range(n):
	(x, y, v) = map(int, input().split())
	t += [pow((a - x) ** 2 + (b - y) ** 2, 0.5) / v]
print('%.8f' % min(t))


import math
(x, y) = [int(x) for x in input().split()]
nb_points = int(input())
nearest = 10000000000.0
for _ in range(nb_points):
	(x1, y1, speed) = [int(x) for x in input().split()]
	x1 -= x
	y1 -= y
	nearest = min(nearest, math.sqrt(x1 * x1 + y1 * y1) / speed)
print(nearest)


(a, b) = map(int, input().split())
n = int(input())
y = 10 ** 6
for _ in range(n):
	(x, z, v) = map(int, input().split())
	y = min(y, ((a - x) ** 2 + (b - z) ** 2) ** (1 / 2) / v)
print(y)


(a, b) = list(map(int, input().split()))
n = int(input())
time = -1
for i in range(n):
	(x, y, v) = list(map(int, input().split()))
	t = ((a - x) ** 2 + (b - y) ** 2) ** 0.5 / v
	if time == -1 or t < time:
		time = t
print(time)


(a, b) = map(int, input().split(' '))
n = int(input())
cars = []
min_t = float('inf')
for i in range(0, n):
	(x, y, v) = map(int, input().split(' '))
	d = ((a - x) ** 2 + (b - y) ** 2) ** (1 / 2)
	t = d / v
	if t < min_t:
		min_t = t
print(min_t)


import math

def beru_taxi():
	position = list(map(int, input().split()))
	taxis = int(input())
	taxi_position = []
	for i in range(taxis):
		taxi_position.append(list(map(int, input().split())))
	best = math.sqrt(abs(taxi_position[0][1] - position[1]) ** 2 + abs(taxi_position[0][0] - position[0]) ** 2) / taxi_position[0][2]
	for i in range(1, len(taxi_position)):
		temp = math.sqrt(abs(taxi_position[i][1] - position[1]) ** 2 + abs(taxi_position[i][0] - position[0]) ** 2) / taxi_position[i][2]
		if temp < best:
			best = temp
	return best
A = beru_taxi()
print(A)


from math import sqrt

def intify(arr):
	for i in range(len(arr)):
		arr[i] = int(arr[i])

class car:

	def __init__(self, xyv):
		self.x_cord = xyv[0]
		self.y_cord = xyv[1]
		self.vel = xyv[2]

	def getTimeTo(self, dist):
		dist = sqrt((dist[0] - self.x_cord) ** 2 + (dist[1] - self.y_cord) ** 2)
		return dist / self.vel

def main():
	person_cord = input().split()
	intify(person_cord)
	nCars = int(input())
	carList = []
	for i in range(nCars):
		new_car = input().split()
		intify(new_car)
		carList.append(car(new_car))
	times = []
	for i in range(nCars):
		times.append(carList[i].getTimeTo(person_cord))
	shortest_time = min(times)
	print(shortest_time)
main()


(a, b) = map(int, input().split())
n = int(input())
g = lambda a, b, c, d: ((a - c) ** 2 + (b - d) ** 2) ** 0.5
L = [0] * n
for k in range(n):
	(c, d, v) = map(int, input().split())
	L[k] = g(a, b, c, d) / v
print('%.20f' % min(L))


(a, b) = map(int, input().split())
ans = float('inf')
for _ in range(int(input())):
	(x, y, v) = map(int, input().split())
	time = ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v
	if time < ans:
		ans = time
print(ans)


(a, b) = input().strip().split(' ')
(a, b) = (int(a), int(b))
n = int(input())
t = 10000000000000
for i in range(n):
	(x, y, v) = input().strip().split(' ')
	(x, y, v) = (int(x), int(y), int(v))
	d = ((x - a) ** 2 + (y - b) ** 2) ** 0.5
	t1 = d / v
	if t1 < t:
		t = t1
print(t)


import math
(a, b) = [int(i) for i in input().split()]
n = int(input())
t = 10 ** 9
for i in range(n):
	(x, y, v) = [int(j) for j in input().split()]
	t = min(t, (abs(a - x) ** 2 + abs(b - y) ** 2) ** 0.5 / v)
print(t)


(a, b) = input().split()
(x, y) = (int(a), int(b))
import math
t = int(input())
tmin = 10000
for i in range(t):
	(a1, b1, v) = input().split()
	(x1, y1) = (int(a1), int(b1))
	speed = int(v)
	d = math.sqrt((x1 - x) ** 2 + (y1 - y) ** 2)
	t = d / speed
	tmin = min(t, tmin)
print(tmin)


(q, w) = map(int, input().split())
a = []
import math
for i in range(int(input())):
	(s, d, f) = map(int, input().split())
	a.append(math.sqrt((s - q) ** 2 + (d - w) ** 2) / f)
print(min(a))


c = input().split(' ')
(a, b) = (int(c[0]), int(c[1]))
n = int(input())
i = 0
res = []
while i < n:
	d = input().split(' ')
	(x, y, s) = (int(d[0]), int(d[1]), int(d[2]))
	dist = ((a - x) ** 2 + (b - y) ** 2) ** 0.5
	t = dist / s
	res.append(t)
	i += 1
print('{:.20f}'.format(min(res)))


import math

def get_input():
	return tuple(map(int, input().split()))

def print_yes_or_no(flag):
	if flag == True:
		print('YES')
	else:
		print('NO')

def get_n_input(n):
	result = []
	for i in range(n):
		result.append(get_input())
	return result
(sx, sy) = get_input()
(n,) = get_input()
time = None
for (x, y, v) in get_n_input(n):
	t_time = math.sqrt((sx - x) ** 2 + (sy - y) ** 2) / v
	time = t_time if time is None else t_time if t_time < time else time
print(time)


import math

def vasTime(vasily, xyv):
	dist = math.sqrt(pow(xyv[0] - vasily[0], 2) + pow(xyv[1] - vasily[1], 2))
	time = dist / xyv[2]
	return time
vas = [int(x) for x in input().split(' ')]
n = int(input())
min_time = 1000000
for i in range(n):
	xyv = [int(x) for x in input().split(' ')]
	min_time = min(min_time, vasTime(vas, xyv))
print(min_time)


from math import sqrt
(x, y) = input().split()
(x, y) = (int(x), int(y))
n = int(input())
best = 1000000000000000000000000000000
for _ in range(n):
	(xx, yy, v) = input().split()
	(xx, yy, v) = (int(xx), int(yy), int(v))
	best = min(best, sqrt((xx - x) ** 2 + (yy - y) ** 2) / v)
print(best)


import sys
import math

def int_pos(pos_str):
	return [int(i) for i in pos_str.split(' ')]
data_in = sys.stdin.readlines()
pos = int_pos(data_in[0])
taxis = [int_pos(data) for data in data_in[2:]]

def dist(a, b):
	return math.sqrt((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2)
min_time = None
for taxi in taxis:
	distance = dist(pos, taxi)
	time = distance / taxi[2]
	if min_time is None or time < min_time:
		min_time = time
print('%0.100f' % min_time)


from math import sqrt
(a, b) = map(int, input().split())
n = int(input())
m = 10000000000
for _ in range(n):
	(xi, yi, vi) = map(int, input().split())
	m = min(sqrt((xi - a) ** 2 + (yi - b) ** 2) / vi, m)
print(m)


from math import sqrt
(x, y) = [int(x) for x in input().split()]
cars = int(input())
dist = []
for i in range(cars):
	dist.append([int(x) for x in input().split()])
min_ = (abs(x - dist[0][0]) + abs(y - dist[0][1])) / dist[0][2]
for car in dist:
	time = sqrt(abs(x - car[0]) ** 2 + abs(y - car[1]) ** 2) / car[2]
	if time < min_:
		min_ = time
print(min_)


(a, b) = map(int, input().split())
ntaxis = int(input())
res = 10 ** 12
for i in range(ntaxis):
	(x, y, v) = map(int, input().split())
	d = abs(a - x) ** 2 + abs(b - y) ** 2
	time = d ** 0.5 / v
	if time < res:
		res = time
print(res)


from collections import Counter
import sys
(x, y) = map(int, input().split())
taxi = int(input())
ans = sys.maxsize
for _ in range(taxi):
	(a, b, v) = map(int, input().split())
	ans = min(ans, ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v)
print(ans)


(a, b) = map(int, input().split())
n = int(input())
(x, y, v) = map(int, input().split())
t = ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v
for i in range(n - 1):
	(x, y, v) = map(int, input().split())
	if ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v < t:
		t = ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v
print('%.7f' % t)


import math
(a, b) = list(map(int, input().split()))
n = int(input())
f = 0
for _ in range(n):
	(x, y, v) = list(map(int, input().split()))
	dis = math.sqrt(math.pow(x - a, 2) + math.pow(y - b, 2))
	t = dis / v
	if f == 0:
		count = t
		f = 1
		continue
	if t < count:
		count = t
ans = float(count)
print('{:.20f}'.format(ans))


import math

def read():
	return [int(x) for x in input().split()]

def dist(x1, y1, x2, y2):
	return math.sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2))

def main():
	(a, b) = read()
	(n,) = read()
	res = None
	for i in range(0, n):
		(x, y, v) = read()
		d = dist(a, b, x, y) / v
		if res is None or res > d:
			res = d
	print(res)
main()


import math
l = input().strip().split()
a = int(l[0])
b = int(l[1])
n = input()
n = int(n)
mintime = 10000
for i in range(n):
	l = input().strip().split()
	x = int(l[0])
	y = int(l[1])
	v = int(l[2])
	dist = math.sqrt((x - a) ** 2 + (y - b) ** 2)
	time = dist / v
	if mintime > time:
		mintime = time
print(mintime)


import math
(a, b) = [int(x) for x in input().split()]
n = int(input())
res = []
for i in range(0, n):
	(x, y, v) = [int(x) for x in input().split()]
	m = abs(x - a)
	n = abs(y - b)
	res.append(math.sqrt(m ** 2 + n ** 2) / v)
print(min(res))


(a, b) = map(int, input().split())
n = int(input())
l = 10 ** 10
for i in range(n):
	(x, y, v) = map(int, input().split())
	d = ((a - x) ** 2 + (b - y) ** 2) ** 0.5
	if d / v < l:
		l = float(d) / v
print(l)


from math import sqrt
(a, b) = [int(x) for x in input().split()]
n = int(input())
t = 1000
for i in range(n):
	(x, y, v) = [int(x) for x in input().split()]
	t = min(t, sqrt((x - a) ** 2 + (y - b) ** 2) / v)
print(t)


(t1, t2) = map(float, input().split())
mat = []
for i in range(int(input())):
	(x, y, v) = map(float, input().split())
	mat.append(((x - t1) ** 2 + (y - t2) ** 2) ** 0.5 / v)
print('%.6f' % min(mat))


(a, b) = map(int, input().split())
n = int(input())
mint = float('inf')
from math import sqrt
for i in range(n):
	(x, y, v) = map(int, input().split())
	d = sqrt((x - a) ** 2 + (y - b) ** 2)
	t = d / v
	if t < mint:
		mint = t
print(mint)


import sys
import math
input = sys.stdin.readline

def inp():
	return int(input())

def inara():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
(a, b) = invr()
n = inp()
ans = 1000000000.0
for i in range(n):
	(x, y, v) = invr()
	dis = math.sqrt((x - a) ** 2 + (y - b) ** 2)
	dis /= v
	ans = min(ans, dis)
print(ans)


(a, b) = map(int, input().split())
result = 4000000
for _ in range(int(input())):
	(x, y, v) = map(int, input().split())
	t = ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v
	if t < result:
		result = t
print(result)


import math
[a, b] = list(map(int, input().split()))
n = int(input())
T = 300
for taxi in range(n):
	[x, y, v] = list(map(int, input().split()))
	t = math.sqrt((x - a) ** 2 + (y - b) ** 2) / v
	if t < T:
		T = t
print(T)


from math import sqrt
(a, b) = map(int, input().split())
tmin = 10 ** 10
(n,) = map(int, input().split())
for i in range(n):
	(x, y, v) = map(int, input().split())
	t = sqrt((a - x) * (a - x) + (b - y) * (b - y)) / v
	tmin = min(tmin, t)
print(tmin)


(a, b) = map(int, input().split())
n = int(input())
t = 0
X = []
for i in range(n):
	(x, y, v) = map(int, input().split())
	t = ((x - a) ** 2 + (y - b) ** 2) ** (1 / 2) / v
	X.append(t)
	t = 0
print(str(min(X)) + '00000000000000000000')


(a, b) = map(int, input().split())
n = int(input())
r = 1000000000.0
for _ in range(n):
	(x, y, v) = map(int, input().split())
	r = min(r, ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v)
print(r)


import math
vasili_cordinate = input()
vasili_cordinate = [int(x) for x in vasili_cordinate.split()]
n = int(input())
taxi_specs = []
for i in range(n):
	x_y_cor = input()
	x_y_cor = [int(x) for x in x_y_cor.split()]
	taxi_specs.append(x_y_cor)
arrive_times = [math.sqrt((x[0] - vasili_cordinate[0]) ** 2 + (x[1] - vasili_cordinate[1]) ** 2) / x[2] for x in taxi_specs]
print(min(arrive_times))


((a, b), n) = (map(int, input().split()), int(input()))
d = lambda x, y: ((x - a) ** 2 + (y - b) ** 2) ** 0.5
arr = []
for _ in range(n):
	(x, y, v) = map(int, input().split())
	arr.append(d(x, y) / v)
print(min(arr))


from math import sqrt
(a, b) = list(map(int, input().split()))
n = int(input())
ans = 100000000000000
for i in range(n):
	(x, y, v) = list(map(int, input().split()))
	t = sqrt((x - a) * (x - a) + (y - b) * (y - b)) / v
	if t < ans:
		ans = t
print(ans)


import math
(bx, by) = map(int, input().split())
loopBorder = int(input())
minTime = math.inf
for i in range(0, loopBorder):
	(ax, ay, v) = map(int, input().split())
	res = math.sqrt((bx - ax) ** 2 + (by - ay) ** 2) / v
	if res < minTime:
		minTime = res
print(minTime)


import math
(a, b) = (int(x) for x in input().split())
n = int(input())
answer = float('inf')
for i in range(n):
	(x, y, v) = (int(x) for x in input().split())
	thetime = math.sqrt((x - a) ** 2 + (y - b) ** 2) / v
	if thetime < answer:
		answer = thetime
print(answer)


import math
(a, b) = map(int, input().split())
n = int(input())
fi = []
for i in range(n):
	fin = 0
	(k, m, s) = map(int, input().split())
	fin = math.sqrt((k - a) ** 2 + (m - b) ** 2)
	fi.append(fin / s)
print(min(fi))


import math
(a, b) = [int(i) for i in input().split()]
n = int(input())
o = []
for i in range(n):
	(x, y, z) = [int(i) for i in input().split()]
	o.append(math.sqrt((x - a) ** 2 + (y - b) ** 2) / z)
print(min(o))


def dist(x1, x2, y1, y2):
	d = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5
	return d
(a, b) = map(int, input().split())
n = int(input())
X = []
Y = []
V = []
for i in range(n):
	(x, y, v) = map(int, input().split())
	X.append(x)
	Y.append(y)
	V.append(v)
U = []
for i in range(n):
	U.append(dist(a, X[i], b, Y[i]) / V[i])
print(min(U))


import math
(x, y) = list(map(int, input().split()))
v = int(input())
c = []
for i in range(v):
	(a, b, s) = list(map(int, input().split()))
	c.append(math.sqrt((a - x) * (a - x) + (b - y) * (b - y)) / s)
print(min(c))


import math
(a, b) = [int(x) for x in input().split()]
min = 100000
n = int(input())
for i in range(0, n):
	(p, q, r) = [int(x) for x in input().split()]
	d = (p - a) ** 2 + (q - b) ** 2
	r = r ** 2
	if d / r < min:
		min = d / r
print(math.sqrt(min))


import math
(a, b) = [int(x) for x in input().split()]
n = int(input())
d = [[0, 0, 0] for i in range(n)]
for i in range(n):
	d[i] = [int(x) for x in input().split()]
mini = 1000000000.0
for i in range(n):
	rasst = (d[i][0] - a) * (d[i][0] - a) + (d[i][1] - b) * (d[i][1] - b)
	mini = min(mini, math.sqrt(rasst) / d[i][2])
print(mini)


(a, b) = map(int, input().split())
n = int(input())
x = []
y = []
v = []
for _ in range(n):
	(xi, yi, vi) = map(int, input().split())
	x.append(xi)
	y.append(yi)
	v.append(vi)
ans = 9999999999
for i in range(n):
	t = ((x[i] - a) ** 2 + (y[i] - b) ** 2) ** 0.5 / v[i]
	ans = min(t, ans)
print(ans)


import math
(x, y) = map(int, input().split())
print(min(((lambda u, v, w: math.sqrt((x - u) ** 2 + (y - v) ** 2) / w)(*map(int, input().split())) for i in range(int(input())))))


from math import sqrt
(a, b) = list(map(int, input().split()))
n = int(input())
l = []
for i in range(n):
	(x, y, v) = list(map(int, input().split()))
	l.append(sqrt((x - a) ** 2 + (y - b) ** 2) / v)
l.sort()
print('%0.18f' % l[0])


(a, b) = list(map(int, input().split()))
n = int(input())
import math
z = []
for _ in range(n):
	(x, y, v) = list(map(int, input().split()))
	dis = math.sqrt((x - a) ** 2 + (y - b) ** 2) / v
	z.append(dis)
print(min(z))


(x, y) = [int(i) for i in input().split()]
num = int(input())
lst = []
for i in range(num):
	(a, b, v) = [int(i) for i in input().split()]
	t = float(((a - x) ** 2 + (b - y) ** 2) ** (1 / 2) / v)
	lst.append(t)
ans = min(lst)
print(ans)


import math
s = input().split()
a = int(s[0])
b = int(s[1])
n = int(input())
x = []
p = 100000000
for i in range(n):
	x.append(input().split())
for i in range(n):
	if p > math.sqrt((int(x[i][0]) - a) ** 2 + (int(x[i][1]) - b) ** 2) / int(x[i][2]):
		p = math.sqrt((int(x[i][0]) - a) ** 2 + (int(x[i][1]) - b) ** 2) / int(x[i][2])
print(p)


import math
(x, y) = map(int, input().split())
n = int(input())
l = []
for _ in range(n):
	(x1, y1, v) = map(int, input().split())
	t = math.sqrt((x - x1) ** 2 + (y - y1) ** 2) / v
	l.append(t)
print(min(l))


from math import sqrt
R = lambda : map(int, input().split())
(a, b) = R()
m = []
n = int(input())
for i in range(n):
	(x, y, v) = R()
	d = sqrt((x - a) ** 2 + (y - b) ** 2)
	t = d / v
	m.append(t)
print('{:.20f}'.format(min(m)))


import math
[a, b] = [int(x) for x in input().split()]
n = int(input())
ans = 1000
for i in range(n):
	[x, y, v] = [int(x) for x in input().split()]
	ans = min(ans, math.sqrt((x - a) * (x - a) + (y - b) * (y - b)) / v)
print(ans)


import math
(x, y) = input().split()
x = int(x)
y = int(y)
count = int(input())
minim = 100000
for i in range(count):
	(q, u, v) = input().split()
	(q, u, v) = (int(q), int(u), int(v))
	s = math.sqrt((q - x) ** 2 + (u - y) ** 2)
	if float(s) / float(v) < minim:
		minim = float(s) / float(v)
print(minim)


import math
(a, b) = map(float, input().split())
n = int(input())
minim = 10000000.0
for i in range(n):
	(x, y, v) = map(float, input().split())
	if math.sqrt((x - a) * (x - a) + (y - b) * (y - b)) / v < minim:
		minim = math.sqrt((x - a) * (x - a) + (y - b) * (y - b)) / v
print(minim)


import math
(a, b) = map(int, input().split())
n = int(input())
min = 100000000
for i in range(n):
	(x, y, v) = map(int, input().split())
	x1 = math.fabs(x - a)
	y1 = math.fabs(y - b)
	dist = math.sqrt(x1 * x1 + y1 * y1)
	time = dist / v
	if time < min:
		min = time
print(min)


import math
(a, b) = [int(i) for i in input().split()]
n = int(input())
w = 1000
for i in range(n):
	(x, y, v) = [int(i) for i in input().split()]
	s = math.sqrt((x - a) ** 2 + (y - b) ** 2) / v
	if s < w:
		w = s
print(w)


(x, y) = map(eval, input().split())
n = eval(input())
minn = 100000000

def dis(x0, y0):
	return ((x - x0) ** 2 + (y - y0) ** 2) ** 0.5
for i in range(n):
	(a, b, v) = map(eval, input().split())
	minn = min(minn, dis(a, b) / v)
print(minn)


import math

def distance(l1, l2):
	(x1, y1) = (l1[0], l1[1])
	(x2, y2) = (l2[0], l2[1])
	d1 = math.pow(x1 - x2, 2)
	d2 = math.pow(y1 - y2, 2)
	return math.sqrt(d1 + d2)
(a, b) = [int(x) for x in input().split()]
n = int(input())
f = 10 ** 5
for case in range(n):
	point = [int(x) for x in input().split()]
	f = min(f, distance((a, b), point[:2]) / point[2])
print(f)


from cmath import sqrt
(x, y) = input().split()
taxi = input()
a = list()
b = list()
for i in range(int(taxi)):
	a.append(input().split())
for i in range(int(taxi)):
	b.append(abs(sqrt((int(x) - int(a[i][0])) ** 2.0 + (int(y) - int(a[i][1])) ** 2.0)) / int(a[i][2]))
print(min(b))


import math
(a, b) = map(int, input().split())
n = int(input())
ans = 10 ** 9
for i in range(n):
	(x, y, v) = map(int, input().split())
	ans = min(ans, math.sqrt(abs(a - x) * abs(a - x) + abs(b - y) * abs(b - y)) / v)
print(ans)


import math
(x1, y1) = input().split(' ')
x1 = int(x1)
y1 = int(y1)
n = int(input())
t = []
for i in range(0, n):
	(x2, y2, v) = input().split(' ')
	x2 = int(x2)
	y2 = int(y2)
	v = int(v)
	d = math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2))
	t.append(float(d) / v)
mini = t[0]
for j in range(0, n):
	if t[j] < mini:
		mini = t[j]
print(mini)


(a, b) = map(int, input().split())
n = int(input())
l = []
for _ in range(n):
	(x, y, v) = map(int, input().split())
	s = ((a - x) ** 2 + (b - y) ** 2) ** (1 / 2)
	l.append(s / v)
l.sort()
print('{:.6f}'.format(l[0]))


from math import *

def time(x0, y0, x1, y1, v):
	d = sqrt((x0 - x1) ** 2 + (y0 - y1) ** 2)
	return d / v
cur = None
(x0, y0) = map(int, input().split())
N = int(input())
for i in range(N):
	(x1, y1, v) = map(int, input().split())
	if cur == None:
		cur = time(x0, y0, x1, y1, v)
	else:
		cur = min(cur, time(x0, y0, x1, y1, v))
print(cur)


ans = float('Inf')
vasCoord = input().split(' ')
a = int(vasCoord[0])
b = int(vasCoord[1])
n = int(input())
for i in range(0, n):
	car = input().split(' ')
	x = int(car[0])
	y = int(car[1])
	v = int(car[2])
	ans = min(ans, ((a - x) ** 2 + (b - y) ** 2) ** 0.5 / v)
print(ans)


import sys
import math
import itertools
import collections

def getdict(n):
	d = {}
	if type(n) is list or type(n) is str:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ' '.join(map(str, arr))

def revn(n):
	return int(str(n)[::-1])

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True
(a, b) = mi()
n = ii()
ans = 300
for i in range(n):
	(x, y, v) = mi()
	ans = min(ans, math.sqrt((x - a) ** 2 + (y - b) ** 2) / v)
print(ans)


import math
[a, b] = list(map(int, input().split()))
n = int(input())
res = 10000000000.0
for i in range(n):
	[x, y, v] = list(map(int, input().split()))
	d = math.sqrt((x - a) * (x - a) + (y - b) * (y - b))
	res = min(res, d / v)
print(res)


alph = 'abcdefghijklmnopqrstuvwxyz'
(a, b) = map(int, input().split())
n = int(input())
E = 10 ** 9
for i in range(n):
	(x, y, v) = map(int, input().split())
	t = ((a - x) ** 2 + (b - y) ** 2) ** 0.5 / v
	E = min(E, t)
print('%.9f' % E)


import math
(x, y) = [int(x) for x in input().split()]
n = int(input())
L = []
for i in range(n):
	(X, Y, V) = [int(x) for x in input().split()]
	L.append(math.sqrt((X - x) ** 2 + (Y - y) ** 2) / V)
print(min(L))


from math import sqrt
(a, b) = map(int, input().split())
value = []
for i in range(int(input())):
	(xi, yi, vi) = map(int, input().split())
	value.append(sqrt((xi - a) ** 2 + (yi - b) ** 2) / vi)
print('%.20f' % min(value))


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	(a, b) = LI()
	t = I()
	aa = [LI() for _ in range(t)]
	r = inf
	for (x, y, v) in aa:
		k = (pow(a - x, 2) + pow(b - y, 2)) ** 0.5
		t = k / v
		if r > t:
			r = t
	return '{:0.9f}'.format(r)
print(main())


from sys import stdin, stdout
(x, y) = map(int, stdin.readline().split())
n = int(stdin.readline())
cares = []
for i in range(n):
	cares.append(tuple(map(int, input().split())))
l = -1
r = 400
while r - l >= 10 ** (-6):
	m = (r + l) / 2
	for i in range(n):
		if ((x - cares[i][0]) ** 2 + (y - cares[i][1]) ** 2) ** 0.5 <= m * cares[i][2]:
			r = m
			break
	else:
		l = m
stdout.write(str(r))


(x, y) = list(map(int, input().split()))
n = int(input())
m = n
result = float('inf')
while m:
	(i, j, t) = list(map(int, input().split()))
	result = min(result, ((x - i) ** 2 + (y - j) ** 2) ** 0.5 / t)
	m = m - 1
print(round(result, 7))


from math import *
try:
	(x1, y1) = map(int, input().split())
	n = int(input())
	m = 10 ** 6
	for _ in range(n):
		(x2, y2, t) = map(int, input().split())
		k = pow(pow(x1 - x2, 2) + pow(y2 - y1, 2), 0.5)
		if k / t < m:
			m = k / t
	print(m)
except:
	pass


import math
(a, b) = map(int, input().split())
n = int(input())
t = 2000000
i = 0
while i < n:
	(x, y, v) = map(int, input().split())
	ti = math.sqrt((a - x) * (a - x) + (b - y) * (b - y)) / v
	if ti < t:
		t = ti
	i += 1
	pass
print(t)


(a, b) = map(int, input().split())
n = int(input())
mn = float('inf')
for i in range(n):
	(x, y, v) = map(int, input().split())
	rx = abs(a - x)
	ry = abs(b - y)
	r = (rx ** 2 + ry ** 2) ** 0.5
	mn = min(mn, r / v)
print(mn)


(a, b) = map(int, input().split())
d = []
for q in range(int(input())):
	(x, y, v) = map(int, input().split())
	d.append(((a - x) ** 2 + (b - y) ** 2) ** 0.5 / v)
print('{0:.20f}'.format(min(d)))


from collections import namedtuple
import math
Point = namedtuple('Point', ['x', 'y'])

def dist(p1, p2):
	return math.sqrt((p1.x - p2.x) ** 2 + (p1.y - p2.y) ** 2)
p0 = Point(*(int(a) for a in input().split()))
n = int(input())
taxi_raw = [[int(x) for x in input().split()] for _ in range(n)]
taxi_infos = [(Point(x, y), v) for (x, y, v) in taxi_raw]
print(min((dist(p0, p) / v for (p, v) in taxi_infos)))


from math import sqrt
(x, y) = map(int, input().split())
n = int(input())
mas = []
for i in range(n):
	(a, b, c) = map(int, input().split())
	mas.append(sqrt((a - x) * (a - x) + (b - y) * (b - y)) / c)
mas.sort()
print(mas[0])


from math import sqrt
(x, y) = map(int, input().split())
n = int(input())
best = float('inf')
for _ in range(n):
	(a, b, v) = map(int, input().split())
	(a, b) = (abs(a - x), abs(b - y))
	dist = sqrt(0.0 + a * a + b * b)
	best = min(best, dist / v)
print(best)


import math
(a, b) = map(int, input().split())
min_time = 10 ** 3
for i in range(int(input())):
	(x, y, v) = map(int, input().split())
	if math.sqrt(abs(a - x) ** 2 + abs(b - y) ** 2) / v < min_time:
		min_time = math.sqrt(abs(a - x) ** 2 + abs(b - y) ** 2) / v
print(min_time)


(a, b) = map(float, input().split())
n = int(input())
ans = 100000000.69
ansidx = -1
for i in range(n):
	(x, y, v) = map(float, input().split())
	ans = min(ans, ((x - a) ** 2 + (y - b) ** 2) ** (1 / 2) / v)
print(ans)


import math
x = [int(i) for i in input().split()]
n = int(input())
mintime = 1000000
for i in range(0, n):
	taxi = [int(j) for j in input().split()]
	distance = math.sqrt((taxi[0] - x[0]) ** 2 + (taxi[1] - x[1]) ** 2)
	time = distance / taxi[2]
	if time < mintime:
		mintime = time
print(mintime)


(a, b) = map(int, input().split())
n = int(input())
k = 100000
for i in range(n):
	(a1, b1, v) = map(int, input().split())
	if ((a1 - a) ** 2 + (b1 - b) ** 2) ** (1 / 2) / v < k:
		k = ((a1 - a) ** 2 + (b1 - b) ** 2) ** (1 / 2) / v
		if k == 0:
			print(round(0, 20))
			exit()
print(round(k, 20))


import math
(a, b) = list(map(int, input().split()))
numberTaxi = int(input())

def distance(x1, y1, x2, y2):
	return math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)
time = 9223372036854775807
for _ in range(0, numberTaxi):
	(x, y, speed) = list(map(int, input().split()))
	dist = distance(a, b, x, y)
	currentTime = dist / speed
	time = min(time, currentTime)
print(time)


import math
(x, y) = map(int, input().split())
n = int(input())
mn = 10000000000
for i in range(n):
	(a, b, v) = map(int, input().split())
	mn = min(mn, math.sqrt((x - a) * (x - a) + (y - b) * (y - b)) / v)
print(mn)


(a, b) = [int(i) for i in input().split()]
n = int(input())
l = []
for i in range(n):
	(x, y, v) = [int(i) for i in input().split()]
	distance = ((x - a) ** 2 + (y - b) ** 2) ** 0.5
	time = distance / v
	l.append(time)
a = str(min(l))
e = len(a) - (a.find('.') + 1)
print(a + '0' * (20 - e))


(x1, y1) = map(int, input().split())
n = int(input().strip())
otvet = []
for i in range(n):
	(xi, yi, vi) = map(int, input().split())
	otvet.append((abs(x1 - xi) ** 2 + abs(y1 - yi) ** 2) ** 0.5 / vi)
print(str(min(otvet)) + '0000000000000000000')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import math
(a, b) = list(map(int, input().split()))
time = 10000
for i in range(int(input())):
	(x, y, v) = list(map(int, input().split()))
	dist = math.sqrt((x - a) ** 2 + (y - b) ** 2)
	time = min(dist / v, time)
print('%.20f' % time)


import math

def get_int_vector():
	return [int(x) for x in input().split()]
(a, b) = get_int_vector()
n = int(input())
result = 1000000000000.0
for _ in range(n):
	(x, y, v) = get_int_vector()
	result = min(result, math.sqrt((a - x) ** 2 + (b - y) ** 2) / v)
print('{:.7f}'.format(result))


from math import sqrt
(a, b) = map(int, input().split())
n = int(input())
mintime = None
for loop in range(n):
	(x, y, v) = map(int, input().split())

	def dist_(a, b, x, y):
		return sqrt((x - a) ** 2 + (y - b) ** 2)
	if mintime == None:
		mintime = dist_(a, b, x, y) / v
	elif dist_(a, b, x, y) / v <= mintime:
		mintime = dist_(a, b, x, y) / v
print('%.10f' % mintime)


import math
(a, b) = map(int, input().split())
n = int(input())
mx = 11111111111111111010000000111
for _ in range(n):
	(x, y, v) = map(int, input().split())
	rezwan = abs(a - x)
	zemi = abs(b - y)
	D = math.sqrt(rezwan * rezwan + zemi * zemi)
	D = float(D)
	v = float(v)
	t = D / v
	if t < mx:
		mx = t
print('%.6f' % mx)


(a, b) = map(int, input().split())
t = 10 ** 9
n = int(input())
for i in range(n):
	(x, y, v) = map(int, input().split())
	m = ((x - a) ** 2 + (y - b) ** 2) ** (1 / 2) / v
	if m < t:
		t = m
print(t)


from cmath import inf
from math import hypot

def ro(O1, O2):
	return hypot(O1[0] - O2[0], O1[1] - O2[1])
(a, b) = map(int, input().split())
n = int(input())
ans = inf
for i in range(n):
	(x, y, v) = map(int, input().split())
	ans = min(ans, ro((a, b), (x, y)) / v)
print(ans)


from sys import stdin
from math import sqrt

def main():
	(a, b) = stdin_get_ints_from_line()
	(n,) = stdin_get_ints_from_line()
	result = list()
	for i in range(n):
		(x, y, v) = stdin_get_ints_from_line()
		t = sqrt((a - x) ** 2 + (b - y) ** 2) / v
		result.append(t)
	print(min(result))
	return

def stdin_get_ints_from_line():
	return (int(x) for x in stdin.readline().strip().split(' '))

def stdin_get_ints_list_from_line():
	return list((int(x) for x in stdin.readline().strip().split(' ')))

def stdin_get_string_from_line():
	return stdin.readline().strip()
main()


(x, y) = map(int, input().strip().split()[:2])
l = []
for q in range(int(input())):
	(x1, y1, v) = map(int, input().strip().split()[:3])
	d = (x - x1) ** 2 + (y - y1) ** 2
	d = d ** (1 / 2)
	l.append(d / v)
print(min(l))


from math import sqrt
ans = 100000.0
(a, b) = map(int, input().split())
n = int(input())
for i in range(n):
	(x, y, p) = map(int, input().split())
	r = (x - a) ** 2 + (y - b) ** 2
	if p is not 0:
		r = sqrt(r) / p
		ans = min(r, ans)
print('{:.7f}'.format(ans))


import sys
import math
from collections import Counter
from collections import OrderedDict
from collections import defaultdict
from functools import reduce
sys.setrecursionlimit(10 ** 6)

def inputt():
	return sys.stdin.readline().strip()

def printt(n):
	sys.stdout.write(str(n) + '\n')

def listt():
	return [int(i) for i in inputt().split()]

def gcd(a, b):
	return math.gcd(a, b)

def lcm(a, b):
	return a * b // gcd(a, b)

def factors(n):
	step = 2 if n % 2 else 1
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(math.sqrt(n)) + 1, step) if n % i == 0)))

def comb(n, k):
	factn = math.factorial(n)
	factk = math.factorial(k)
	fact = math.factorial(n - k)
	ans = factn // (factk * fact)
	return ans

def is_prime(n):
	if n <= 1:
		return False
	if n == 2:
		return True
	if n > 2 and n % 2 == 0:
		return False
	max_div = math.floor(math.sqrt(n))
	for i in range(3, 1 + max_div, 2):
		if n % i == 0:
			return False
	return True

def maxpower(n, x):
	B_max = int(math.log(n, x)) + 1
	return B_max
t = 1
for _ in range(t):
	(a, b) = map(int, input().split())
	n = int(input())
	l = []
	for i in range(n):
		(x, y, v) = map(int, input().split())
		d = math.sqrt(pow(a - x, 2) + pow(b - y, 2))
		time = d / v
		l.append(time)
	print('{0:.8f}'.format(min(l)))


import math
(x, y) = input().split()
x = int(x)
y = int(y)
taxi = int(input())
best = 999999999999
for i in range(0, taxi):
	(a, b, c) = input().split()
	a = int(a)
	b = int(b)
	c = int(c)
	t = math.sqrt(math.pow(x - a, 2) + math.pow(y - b, 2)) / c
	if t < best:
		best = t
print(best)


import sys
import math
(a, b) = map(int, sys.stdin.readline().split())
n = int(input())
ans = 800.0
for i in range(n):
	(x, y, v) = map(int, sys.stdin.readline().split())
	cur = math.sqrt((x - a) * (x - a) + (y - b) * (y - b)) / v
	if cur < ans:
		ans = cur
print(ans)


import math
(x1, y1) = list(map(int, input().split()))
n = int(input())
min = None
for i in range(0, n):
	(x2, y2, v) = list(map(int, input().split()))
	t = math.sqrt((x2 - x1) ** 2 + (y1 - y2) ** 2) / v
	if min != None:
		if min > t:
			min = t
	else:
		min = t
print('%10f' % min)


from math import sqrt
(a, b) = list(map(int, input().split(' ')))
n = int(input())
Min = 1000000000
for i in range(n):
	(x, y, v) = list(map(int, input().split(' ')))
	Min = min(Min, sqrt(pow(a - x, 2) + pow(b - y, 2)) / v)
print(Min)


import math as g
(x, y) = map(int, input().split())
t1 = []

def fun(x, y, a, b):
	s1 = (x - a) ** 2
	s2 = (y - b) ** 2
	d = g.sqrt(s1 + s2)
	return d
for _ in range(int(input())):
	(a, b, t) = map(int, input().split())
	t1.append(round(fun(x, y, a, b) / t, 8))
print(min(t1))


import sys
input = sys.stdin.buffer.readline
import os
from math import *
(a, b) = map(int, input().split())
t = int(input())
ans = []
while t:
	t -= 1
	(x, y, v) = map(int, input().split())
	d = sqrt((x - a) * (x - a) + (y - b) * (y - b))
	t1 = d / v
	ans.append(t1)
print(min(ans))


import math
(a, b) = map(int, input().split())
n = int(input())
(x, y, z) = map(int, input().split())
minn = math.sqrt((x - a) ** 2 + (y - b) ** 2) / z
for i in range(1, n):
	(x, y, z) = map(int, input().split())
	minn = min(minn, math.sqrt((x - a) ** 2 + (y - b) ** 2) / z)
print('{0:.6f}'.format(minn))


(a, b) = [int(x) for x in input().split()]
n = int(input())
time = []
for i in range(n):
	(x, y, v) = [int(x) for x in input().split()]
	time.append(((a - x) ** 2 + (b - y) ** 2) ** 0.5 / v)
print('{:.15f}'.format(min(time)))


(a, b) = list(map(int, input().split()))
m = []
for i in range(int(input())):
	(x, y, v) = list(map(int, input().split()))
	d = ((x - a) ** 2 + (y - b) ** 2) ** (1 / 2)
	m.append(d / v)
print(min(m))


(x0, y0) = [int(j) for j in input().split()]
n = int(input())
time = None
for j in range(n):
	(x, y, v) = [int(j) for j in input().split()]
	if x == x0 and y == y0:
		time = 0
	else:
		d = (x - x0) ** 2 + (y - y0) ** 2
		d = pow(d, 0.5)
		t = d / v
		if time == None:
			time = t
		else:
			time = min(time, t)
print(time)


import math
(x, y) = map(int, input().split())
t = int(input())
min1 = 100000000
for i in range(t):
	(a, b, c) = map(int, input().split())
	k = math.sqrt((x - a) * (x - a) + (y - b) * (y - b)) / c
	if min1 > k:
		min1 = k
print(min1)


import math

def calLength(p1, p2):
	l = math.pow(p1[0] - p2[0], 2) + math.pow(p1[1] - p2[1], 2)
	return math.sqrt(l)

def main():
	getS = input()
	getS = getS.split()
	a = int(getS[0])
	b = int(getS[1])
	n = int(input())
	v = [a, b]
	taxi = []
	for i in range(0, n):
		ta = []
		getS = input()
		getS = getS.split()
		ta.append(int(getS[0]))
		ta.append(int(getS[1]))
		ta.append(int(getS[2]))
		taxi.append(ta)
	re = False
	for i in range(0, len(taxi)):
		t = calLength(v, taxi[i]) / taxi[i][2]
		if t == 0:
			print(0)
			return
		if re == False or (re != False and re > t):
			re = t
	print(float(re))
main()


import sys, os, io
from sys import stdin
from math import log, gcd, ceil
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import math
alphabets = list('abcdefghijklmnopqrstuvwxyz')

def isPrime(x):
	for i in range(2, x):
		if i * i > x:
			break
		if x % i == 0:
			return False
	return True

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(int(i))
			n = n / i
	if n > 2:
		l.append(n)
	return list(set(l))

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def si():
	return input()

def prefix_sum(arr):
	r = [0] * (len(arr) + 1)
	for (i, el) in enumerate(arr):
		r[i + 1] = r[i] + el
	return r

def divideCeil(n, x):
	if n % x == 0:
		return n // x
	return n // x + 1

def ii():
	return int(input())

def li():
	return list(map(int, input().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')

def power_set(L):
	cardinality = len(L)
	n = 2 ** cardinality
	powerset = []
	for i in range(n):
		a = bin(i)[2:]
		subset = []
		for j in range(len(a)):
			if a[-j - 1] == '1':
				subset.append(L[j])
		powerset.append(subset)
	powerset_orderred = []
	for k in range(cardinality + 1):
		for w in powerset:
			if len(w) == k:
				powerset_orderred.append(w)
	return powerset_orderred

def fastPlrintNextLines(a):
	print('\n'.join(map(str, a)))
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
else:
	input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
t = 1
for _ in range(t):
	(a, b) = li()
	n = ii()
	m = 10000000000000000
	for i in range(n):
		(x, y, v) = li()
		d = (abs(x - a) ** 2 + abs(y - b) ** 2) ** 0.5
		m = min(d / v, m)
	print(m)


F = lambda : map(int, input().split())
(a, b) = F()
n = int(input())
ans = 10 ** 9
for i in range(n):
	(x, y, v) = F()
	ans = min(ans, ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v)
print(ans)


from math import sqrt
(x, y) = map(int, input().split())
n = int(input())
mint = float('inf')
for i in range(n):
	(x1, y1, v) = map(int, input().split())
	D = sqrt((x1 - x) ** 2 + (y1 - y) ** 2)
	t = D / v
	mint = min(t, mint)
print(mint)


(x, y) = map(int, input().split())
n = int(input())
from math import sqrt as S
mini = 100000000000.0
for i in range(n):
	(a, b, v) = map(int, input().split())
	dist = S((x - a) * (x - a) + (y - b) * (y - b))
	t = dist / v
	if t < mini:
		mini = t
print(mini)


(x, y) = map(int, input().split())
n = int(input())
mi = 11 ** 11
for _ in range(n):
	(xt, yt, v) = map(int, input().split())
	t = ((x - xt) ** 2 + (y - yt) ** 2) ** 0.5 / v
	if t < mi:
		mi = t
print(mi)


import math
(a, b) = map(int, input().split())
n = int(input())
l = []
while n:
	(x, y, v) = map(int, input().split())
	d = math.sqrt(math.pow(a - x, 2) + math.pow(b - y, 2))
	t = d / v
	l.append(t)
	n = n - 1
print(min(l))


import math
s = input().split()
a = int(s[0])
b = int(s[1])
n = int(input())
maxk = 9999999999999999999999999
for _ in range(n):
	s = input().split()
	x = int(s[0])
	y = int(s[1])
	v = int(s[2])
	k = 0
	k += math.sqrt((x - a) ** 2 + (y - b) ** 2)
	k /= v
	if k < maxk:
		maxk = float(k)
print(maxk)


import sys
readline = sys.stdin.readline

def f(x, y, v):
	return ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v
(a, b) = map(int, readline().split())
N = int(readline())
ans = 10 ** 9
for _ in range(N):
	(x, y, v) = map(int, readline().split())
	ans = min(ans, f(x, y, v))
print(ans)


from math import sqrt
vasily = [int(x) for x in input().split(' ')]
no_cars = int(input())
cars = []
for i in range(no_cars):
	cars.append([int(x) for x in input().split(' ')])
times = []
for car in cars:
	times.append(sqrt((vasily[0] - car[0]) ** 2 + (vasily[1] - car[1]) ** 2) / car[2])
print(sorted(times)[0])


from math import sqrt

def dist(x, y, a, b):
	res = (x - a) ** 2 + (y - b) ** 2
	res = sqrt(res)
	return res

def main():
	(a, b) = map(int, input().split())
	n = int(input())
	t = 10000000
	for j in range(n):
		(x, y, v) = map(int, input().split())
		t = min(dist(x, y, a, b) / v, t)
	print(t)
main()


import math
(a, b) = (int(x) for x in input().split())
best = float('INF')
for _ in range(int(input())):
	(x, y, v) = (int(x) for x in input().split())
	best = min(best, math.sqrt((a - x) ** 2 + (b - y) ** 2) / v)
print(best)


m = []
(a, b) = map(int, input().split())
n = int(input())
for _ in range(n):
	(x, y, v) = map(int, input().split())
	if x > a:
		c = (x - a) ** 2
	else:
		c = (a - x) ** 2
	if y > b:
		s = (y - b) ** 2
	else:
		s = (b - y) ** 2
	sqrt = (c + s) ** 0.5 / v
	m.append(sqrt)
print(min(m))


(a, b) = map(int, input().split())
n = int(input())
ans = 999999999999999999999999999999
for i in range(n):
	(x, y, v) = map(int, input().split())
	ans = min(ans, ((x - a) ** 2 + (y - b) ** 2) ** 0.5 / v)
print('%.50f' % ans)


(my_x, my_y) = map(int, input().split())
first_time = True
for i in range(int(input())):
	(taxi_x, taxi_y, velocity) = map(int, input().split())
	time = ((my_x - taxi_x) ** 2 + (my_y - taxi_y) ** 2) ** 0.5 / velocity
	if first_time:
		min_time = time
		first_time = False
	else:
		min_time = min(min_time, time)
print('%.6f' % min_time)


import math
(x, y) = map(int, input().split())
ans = 99999999999999999
for i in range(int(input())):
	(a, b, v) = map(int, input().split())
	dist = math.sqrt((x - a) ** 2 + (y - b) ** 2)
	time = dist / v
	ans = min(ans, time)
print(ans)


import sys, math
(a, b) = [int(i) for i in input().split(' ')]
n = int(input())
mins = -1.0
for i in range(n):
	(a2, b2, v) = [int(i) for i in input().split(' ')]
	min1 = math.sqrt((a2 - a) * (a2 - a) + (b2 - b) * (b2 - b)) / v
	if mins == -1.0:
		mins = min1
	elif min1 < mins:
		mins = min1
print('%.20f' % mins)


from math import sqrt
__author__ = 'artyom'

def main():
	(a, b) = read(3)
	tmin = 10000000000.0
	for i in range(read()):
		(x, y, v) = read(3)
		t = sqrt((x - a) * (x - a) + (y - b) * (y - b)) / v
		if t < tmin:
			tmin = t
	return tmin

def read(mode=1, size=None):
	if mode == 0:
		return input().strip()
	if mode == 1:
		return int(input().strip())
	if mode == 2:
		return input().strip().split()
	if mode == 3:
		return list(map(int, input().strip().split()))
	a = []
	for _ in range(size):
		a.append(read(3))
	return a

def write(s='\n'):
	if s is None:
		s = ''
	if isinstance(s, tuple) or isinstance(s, list):
		s = ' '.join(map(str, s))
	s = str(s)
	print(s, end='\n')
write(main())


(a, b) = map(int, input().split())
n = int(input())
mi = 1000000
for i in range(n):
	(x1, y1, v) = map(int, input().split())
	d = ((x1 - a) ** 2 + (y1 - b) ** 2) ** (1 / 2)
	t = d / v
	if mi > t:
		mi = t
print(mi)


import math
(a, b) = map(int, input().split())
d = None
for _ in '0' * int(input()):
	(x, y, v) = map(int, input().split())
	ds = math.sqrt((a - x) ** 2 + (b - y) ** 2) / v
	if d is None or d > ds:
		d = ds
print(d)


(a, b) = map(int, input().split())
n = int(input())
ans = float('inf')
for it in range(n):
	(x, y, v) = map(int, input().split())
	dist = (x - a) ** 2 + (y - b) ** 2
	dist = dist ** 0.5
	time = dist / v
	ans = min(ans, time)
print('%.32f' % ans)