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>
const double pi = acos(-1.0);
using namespace std;
int i, j, k, m, n;
int hit_road[10000];
double x[10000], y[10000], a[10000], w[10000], v, t, d, d1, d2, S, a1, a2, v1,
    v2, _x, _k;
double X1, Y1, X2, Y2, ans, A, B, C;
int hit(double x, double y, double a, double w) {
  double alp;
  alp = atan2(Y2 - y, X2 - x) - a;
  while (alp < 0) alp += 2 * pi;
  while (alp >= 2 * pi) alp -= 2 * pi;
  if (alp <= w * t) return 1;
  alp = a - atan2(Y2 - y, X2 - x);
  while (alp < 0) alp += 2 * pi;
  while (alp >= 2 * pi) alp -= 2 * pi;
  if (alp <= w * t) return 1;
  double t0 = 1e9;
  alp = atan2(Y1 - y, X1 - x) - a;
  while (alp < 0) alp += 2 * pi;
  while (alp >= 2 * pi) alp -= 2 * pi;
  t0 = min(t0, alp / w);
  alp = a - atan2(Y1 - y, X1 - x);
  while (alp < 0) alp += 2 * pi;
  while (alp >= 2 * pi) alp -= 2 * pi;
  t0 = min(t0, alp / w);
  if (t0 >= t - 1e-8) return 0;
  d1 = hypot(X1 - x, Y1 - y);
  d2 = hypot(X2 - x, Y2 - y);
  S = ((X1 - x) * (Y2 - y) - (X2 - x) * (Y1 - y)) / d2 / d1;
  alp = asin(fabs(S));
  double t1 = t0, t2 = t;
  for (int iter = 0; iter <= 70; iter++) {
    double T1 = (t1 * 2 + t2) / 3, T2 = (t1 + 2 * t2) / 3;
    a1 = T1 * w;
    a2 = alp - a1;
    _k = d1 * sin(a1) / d2 / sin(a2);
    _x = d * _k / (_k + 1);
    v1 = T1 * v - _x;
    a1 = T2 * w;
    a2 = alp - a1;
    _k = d1 * sin(a1) / d2 / sin(a2);
    _x = d * _k / (_k + 1);
    v2 = T2 * v - _x;
    if (v1 < v2) {
      if (v1 <= 0) {
        return 1;
      }
      t2 = T2;
    } else {
      if (v2 <= 0) {
        return 1;
      }
      t1 = T1;
    }
  }
  return 0;
}
int main() {
  cin >> X1 >> Y1 >> X2 >> Y2;
  A = Y2 - Y1;
  B = X1 - X2;
  C = A * X1 + B * Y1;
  d = hypot(X2 - X1, Y2 - Y1);
  cin >> n;
  for (i = 0; i < n; i++) cin >> x[i] >> y[i] >> a[i] >> w[i];
  cin >> k;
  double P = 0.00, Q = 1e7;
  while (Q - P > 1e-5) {
    v = (P + Q) / 2;
    m = 0;
    t = d / v;
    for (i = 0; i < n; i++) {
      m += hit(x[i], y[i], a[i], w[i]);
      if (m > k) break;
    }
    if (i == n)
      Q = v;
    else
      P = v;
  }
  printf("%.4lf", v);
  return 0;
}
