#include <bits/stdc++.h>
using namespace std;
double dist(double x1, double y1, double x2, double y2)
{
double dx = x2 - x1;
double dy = y2 - y1;
return sqrt(dx * dx + dy * dy);
}
int main()
{
int X, Y;
cin >> X >> Y;
int n, k;
cin >> n >> k;
vector<double> distances(n);
for (int i = 0; i < n; i++)
{
int x, y;
cin >> x >> y;
distances[i] = dist(X, Y, x, y);
}
nth_element(distances.begin(), distances.begin() + k - 1, distances.end());
cout << fixed << setprecision(9) << distances[k - 1] << "\n";
return 0;
}