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

#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
double INF = 1e100;
double EPS = 1e-12;
struct PT {
  double x, y;
  PT() {}
  PT(double x, 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*(double c) const { return PT(x * c, y * c); }
  PT operator/(double c) const { return PT(x / c, y / c); }
};
PT A, B;
vector<PT> a;
vector<long double> an, w;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> A.x >> A.y >> B.x >> B.y;
  int N, K;
  cin >> N;
  a.resize(N);
  an.resize(N);
  w.resize(N);
  vector<long double> sp;
  for (int i = 0; i < N; i++) {
    cin >> a[i].x >> a[i].y >> an[i] >> w[i];
    long double f = atan2(A.y - a[i].y, A.x - a[i].x),
                s = atan2(B.y - a[i].y, B.x - a[i].x);
    f -= an[i];
    s -= an[i];
    while (f < 0.0) f += 2 * acos(-1.0);
    while (s < 0.0) s += 2 * acos(-1.0);
    if (w[i]) sp.push_back(fminl(f, s) / w[i]);
  }
  cin >> K;
  sort(sp.begin(), sp.end());
  if (K >= sp.size())
    cout << "0\n";
  else
    cout << fixed << setprecision(9) << hypotl(A.x - B.x, A.y - B.y) / sp[K]
         << '\n';
  return 0;
}
