0 0 10 10
1
10 0 0 1.57079
0
 -88 -68 -10 -61
5
-64 -55 3.09648 0.28346
-8 -52 2.46781 0.13262
-8 -59 3.02445 0.00119
-40 90 2.37292 0.15686
-29 -34 2.73957 0.18287
0
 0 0 10 10
2
10 0 0 1.57079
10 5 0 0.7854
1
 -100000 -100000 100000 100000
1
100000 0 0 15.70796
0
 -3 -7 -14 2
5
-16 19 2.12587 0.30781
9 -19 3.27418 0.06595
-1 12 0.12414 8.82294
20 10 6.25657 0.77605
-10 17 0.29502 6.31019
5

14.142079
 7.216642
 7.071084
 2828426.5363
 0.0000

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

template<class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
using namespace std;
/***********************************************/
/* Dear online judge:
 * I've read the problem, and tried to solve it.
 * Even if you don't accept my solution, you should respect my effort.
 * I hope my code compiles and gets accepted.
 *  ___  __     _______    _______ 
 * |\  \|\  \  |\  ___ \  |\  ___ \
 * \ \  \/  /|_\ \   __/| \ \   __/|
 *  \ \   ___  \\ \  \_|/__\ \  \_|/__  
 *   \ \  \\ \  \\ \  \_|\ \\ \  \_|\ \ 
 *    \ \__\\ \__\\ \_______\\ \_______\
 *     \|__| \|__| \|_______| \|_______|
 */
const long long mod = 1000000007;

const long double INF = 1e100;
const long double EPS = 1e-12;

const long double PI = acosl(-1.0);

struct PT {
	long double x, y;
	PT() :
		x(0), y(0) {
	}
	PT(long double _x, long double _y) :
		x(_x), y(_y) {
	}
	PT(const PT &p) :
		x(p.x), y(p.y) {
	}
	PT operator +(const PT &p) const {
		return PT(x + p.x, y + p.y);
	}
	PT operator -(const PT &p) const {
		return PT(x - p.x, y - p.y);
	}
	PT operator *(long double c) const {
		return PT(x * c, y * c);
	}
	PT operator /(long double c) const {
		return PT(x / c, y / c);
	}
	bool operator<(const PT &p) const {
		return make_pair(x, y) < make_pair(p.x, p.y);
	}

	bool operator==(const PT &p) const {
		return fabsl(x - p.x) > EPS || fabsl(y - p.y) > EPS;
	}
};
long double dot(PT p, PT q) {
	return p.x * q.x + p.y * q.y;
}
long double dist2(PT p, PT q) {
	return dot(p - q, p - q);
}
long double cross(PT p, PT q) {
	return p.x * q.y - p.y * q.x;
}
PT norm(PT x, long double l)    { return x * sqrt(l*l / dot(x,x));}
istream &operator>>(istream &is, PT &p) {
	return is >> p.x >> p.y;
}
ostream &operator<<(ostream &os, const PT &p) {
	return os << "(" << p.x << "," << p.y << ")";
}
/*around the origin*/
PT RotateCCW90(PT p) {
	return PT(-p.y, p.x);
}
PT RotateCW90(PT p) {
	return PT(p.y, -p.x);
}
PT RotateCCW(PT p, long double t) { 
	return PT(p.x*cos(t)-p.y*sin(t), p.x*sin(t)+p.y*cos(t)); 
}
// project point c onto line through a and b (assuming a != b)
PT ProjectPointLine(PT a, PT b, PT c) {
	return a + (b-a)*dot(c-a, b-a)/dot(b-a, b-a);
}

PT A,B;

long double F(long double x, PT a, long double v, long double an) {
	PT to = norm(B-A, x) + A;
	long double tob = atan2l(to.y - a.y,to.x - a.x);
	if(tob < 0) tob += 2 * PI;
	tob = min(fabsl(tob-an), 2 * PI - fabsl(tob-an));
	return x * v / tob;
}

int main(int argc, char** argv) {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	cout<<fixed<<setprecision(7);

	int N,K;
	cin>>A>>B>>N;
	PT a;
	long double an;
	long double v;
	vector<long double> t(N);

	for(int i = 0;i < N;i++) {
		cin>>a>>an>>v;
		long double tob = atan2l(B.y - a.y,B.x - a.x);
		if(tob < 0) tob += 2 * PI;
		t[i] = fminl(fabsl(tob-an), 2*PI - fabsl(tob-an)) / v;
		PT proj = ProjectPointLine(A,B,a);
		long double lo = 0,hi = sqrtl(dist2(proj,A));
		for(int k = 0;k < 100;k++) {
			long double md1 = (2*lo+hi) / 3;
			long double md2 = (lo+2*hi) / 3;
			long double v1 = F(md1, a, v, an);
			long double v2 = F(md2, a, v, an);
			if(v1 <= v2) lo = md1;
			else hi = md2;
		}
		long double vt = F((lo+hi)/2, a, v, an);
		t[i] = fminl(t[i], sqrtl(dist2(B,A))/vt);
	}

	cin>>K;
	if(K == N) {
		cout<<"0\n";
		return 0;
	}

	sort(t.begin(),t.end());
	cout<<sqrtl(dist2(A,B))/t[K]<<'\n';
	return 0;
}
