#include <iostream>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <vector>
using namespace std;
typedef long double ld;
struct evt{
	ld t; int q;
};
bool cmp(evt a, evt b) {
	return a.t < b.t;
}
inline ld dist(ld a, ld b) {
	return sqrt(a*a + b*b);
}
int main() {
	int cx, cy, n, k;
	cin >> cx >> cy >> n >> k;
	ld *x = new ld[n], *y = new ld[n], *vx = new ld[n], *vy = new ld[n];
	ld *a = new ld[n], *b = new ld[n], *c = new ld[n];
	ld lo = 0, hi = 0;
	for(int i=0; i<n; i++) {
		cin >> x[i] >> y[i] >> vx[i] >> vy[i];
		vx[i]-=x[i];
		vy[i]-=y[i];
		x[i]-=cx;
		y[i]-=cy;
		a[i] = vx[i]*vx[i] + vy[i]*vy[i];
		b[i] = 2*(vx[i]*x[i] + vy[i]*y[i]);
		c[i] = x[i]*x[i] + y[i]*y[i];
		hi = max(hi, dist(x[i], y[i])*100);
	}
	while(hi-lo > 1e-7) {
		ld r = (hi+lo)/2;
		vector<evt> sweep;
		for(int i=0; i<n; i++) {
			ld aa = a[i], bb = b[i], cc = c[i]-r*r;
			if(aa < 0.5) continue;
			if(bb*bb < 4*aa*cc) continue;
			ld determinant = sqrt(bb*bb - 4*aa*cc)/2/aa;
			ld zxcv = -bb/2/aa;
			if(zxcv + determinant <= 0) continue;
			evt start, end;
			start.q = 0; end.q = 1;
			start.t = max(zxcv - determinant, 0.0L);
			end.t = max(zxcv + determinant, 0.0L);
			//cerr << "       " << start.t << " " << end.t << endl;
			sweep.push_back(start);
			sweep.push_back(end);
		}
		sort(sweep.begin(), sweep.end(), cmp);
		int fish = 0;
		for(int de=0, i=0, _i = sweep.size(); i<_i; i++) {
			if(sweep[i].q) {
				de--;
			} else {
				de++;
			}
			if(de>fish) fish = de;
		}
		if(fish >= k) {
			hi = r;
		} else {
			lo = r;
		}
		//cerr << r << " " << fish << endl;
	}
	cout << fixed << setprecision(5) << hi << endl;
	
	return 0;
}