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;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
const double pi = 2 * asin(1.0);
int n;
int m;
double x[10000], y[10000], a[10000], w[10000];
double ax, ay, bx, by;
double dist(double x1, double y8687969, double x2, double y2) {
  return sqrt(
      abs(((x2 - x1) * (x2 - x1)) + ((y2 - y8687969) * (y2 - y8687969))));
}
double get(int i, double x, double y) {
  double b = atan2(y - ::y[i], x - ::x[i]);
  return min(abs(a[i] - b), 2 * pi - abs(a[i] - b)) / w[i];
}
double cross(double x1, double y8687969, double x2, double y2, double x3,
             double y3, double x4, double y4) {
  double a = x2 - x1;
  double b = x3 - x4;
  double c = x3 - x1;
  double d = y2 - y8687969;
  double e = y3 - y4;
  double f = y3 - y8687969;
  return (c * e - b * f) / (a * e - b * d);
}
int calc(double v) {
  int tmp = 0;
  double d = dist(ax, ay, bx, by);
  double dx = (bx - ax);
  double dy = (by - ay);
  double t = d / v;
  for (int i = 0; i < n; i++) {
    if (w[i] < 1e-6) continue;
    if (get(i, bx, by) < t)
      tmp++;
    else {
      double l = 0,
             r = max(0.0, min(1.0, cross(ax, ay, bx, by, x[i], y[i],
                                         x[i] + (by - ay), y[i] + (ax - bx))));
      for (int it = 0; it < 40; it++) {
        double s1 = (2 * l + r) / 3;
        double s2 = (l + 2 * r) / 3;
        double d1 = get(i, ax + dx * s1, ay + dy * s1) - t * s1;
        double d2 = get(i, ax + dx * s2, ay + dy * s2) - t * s2;
        if (d1 < d2)
          r = s2;
        else
          l = s1;
      }
      double ss = (l + r) / 2;
      double dd = get(i, ax + dx * ss, ay + dy * ss) - t * ss;
      if (dd < 0) tmp++;
    }
  }
  return tmp;
}
int main() {
  cin >> ax >> ay >> bx >> by >> n;
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i] >> a[i] >> w[i];
  cin >> m;
  double l = 0, r = 1e18;
  for (int it = 0; it < 100; it++) {
    double s = (l + r) / 2;
    if (calc(s) <= m)
      r = s;
    else
      l = s;
  }
  printf("%.10f\n", r);
  return 0;
}
