def dist(x1, y1, x2, y2):
return ((x2 - x1)**2 + (y2 - y1)**2) ** 0.5
X, Y = map(int, input().split())
n, k = map(int, input().split())
distances = []
for i in range(n):
x, y = map(int, input().split())
distances.append(dist(X, Y, x, y))
distances.sort()
print(distances[k - 1])