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 int MAXN = 10000;
int n;
double x1, y3223789, x2, y2;
double x[MAXN], y[MAXN], w[MAXN], a0[MAXN];
double t1[MAXN], t2[MAXN], d[MAXN], p[MAXN];
double pi = 2 * acos(0.0);
double cross(double x1, double y3223789, double x2, double y2) {
  return x1 * y2 - x2 * y3223789;
}
double getmin(double x) {
  while (x < 0) x += 2 * pi;
  while (x > 2 * pi) x -= 2 * pi;
  return min(x, 2 * pi - x);
}
double get_time(int i, double xx, double yy) {
  double ang = atan2(yy - y[i], xx - x[i]) - a0[i];
  return getmin(ang) / w[i];
}
double inter(double x1, double y3223789, double x2, double y2, double x3,
             double y3, double x4, double y4) {
  double d = cross(x2 - x1, y2 - y3223789, x3 - x4, y3 - y4);
  double p = cross(x2 - x1, y2 - y3223789, x3 - x1, y3 - y3223789);
  return p / d;
}
double nt;
int check(int i, double v) {
  if (get_time(i, x2, y2) < nt) return 1;
  if (p[i] < 0) return 0;
  double l = 0, r = min(1.0, p[i]);
  for (int o = 0; o < 40; o++) {
    double c1 = (l * 2 + r) / 3;
    double c2 = (l + 2 * r) / 3;
    double cx1 = x1 * (1 - c1) + x2 * c1;
    double cy1 = y3223789 * (1 - c1) + y2 * c1;
    double cx2 = x1 * (1 - c2) + x2 * c2;
    double cy2 = y3223789 * (1 - c2) + y2 * c2;
    double t1 = get_time(i, cx1, cy1);
    double t2 = get_time(i, cx2, cy2);
    t1 -= nt * c1;
    t2 -= nt * c2;
    if (t1 < 0 || t2 < 0) return 1;
    if (t1 < t2)
      r = c2;
    else
      l = c1;
  }
  return 0;
}
int getans(double v) {
  int ans = 0;
  nt = sqrt((x2 - x1) * (x2 - x1) + (y2 - y3223789) * (y2 - y3223789)) / v;
  for (int i = 0; i < n; i++)
    if (check(i, v)) ans++;
  return ans;
}
int main() {
  cin >> x1 >> y3223789 >> x2 >> y2;
  double dist = sqrt((x2 - x1) * (x2 - x1) + (y2 - y3223789) * (y2 - y3223789));
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i] >> a0[i] >> w[i];
    double tmp = cross(x[i] - x1, y[i] - y3223789, x[i] - x2, y[i] - y2);
    t1[i] = get_time(i, x1, y3223789);
    t2[i] = get_time(i, x2, y2);
    p[i] = inter(x[i], y[i], x[i] + y2 - y3223789, y[i] + x1 - x2, x1, y3223789,
                 x2, y2);
    d[i] = abs(tmp) / dist;
  }
  int k;
  cin >> k;
  double tt[MAXN];
  for (int i = 0; i < n; i++) {
    double l = 0, r = 4000000;
    while (r - l > 1e-5) {
      double v = (l + r) / 2;
      nt = sqrt((x2 - x1) * (x2 - x1) + (y2 - y3223789) * (y2 - y3223789)) / v;
      if (check(i, v))
        l = v;
      else
        r = v;
    }
    tt[i] = (l + r) / 2;
  }
  sort(tt, tt + n);
  reverse(tt, tt + n);
  if (k == n)
    printf("%.4lf", 0.0);
  else
    printf("%.4lf", tt[k]);
  cout << endl;
  return 0;
}
