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>
int main(int argc, char** argv) {
  double x1, y1, x2, y2, x3, y3, x5, y5, x1tab[10000], y1tab[10000],
      x5tab[10000], y5tab[10000], angle[10000], w[10000];
  int k, n;
  double length;
  double miny[10000];
  scanf("%lf%lf%lf%lf", &x2, &y2, &x3, &y3);
  length =
      sqrt(x2 * x2 - 2 * x2 * x3 + x3 * x3 + y2 * y2 - 2 * y2 * y3 + y3 * y3);
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lf%lf%lf%lf", &x5tab[i], &y5tab[i], &angle[i], &w[i]);
    x1tab[i] = cos(angle[i]);
    y1tab[i] = sin(angle[i]);
  }
  scanf("%d", &k);
  for (int i = 0; i < n; i++) {
    x1 = x1tab[i];
    y1 = y1tab[i];
    x5 = x5tab[i];
    y5 = y5tab[i];
    double a, b, c, d, e;
    a = x1 * (x3 - x2) /
            sqrt(x2 * x2 - 2 * x2 * x3 + x3 * x3 + y2 * y2 - 2 * y2 * y3 +
                 y3 * y3) +
        y1 * (y3 - y2) /
            sqrt(x2 * x2 - 2 * x2 * x3 + x3 * x3 + y2 * y2 - 2 * y2 * y3 +
                 y3 * y3);
    b = x1 * (x2 - x5) + y1 * (y2 - y5);
    c = (x3 - x2) * (x3 - x2) /
            (x2 * x2 - 2 * x2 * x3 + x3 * x3 + y2 * y2 - 2 * y2 * y3 +
             y3 * y3) +
        (y3 - y2) * (y3 - y2) /
            (x2 * x2 - 2 * x2 * x3 + x3 * x3 + y2 * y2 - 2 * y2 * y3 + y3 * y3);
    d = (2 * (x2 - x5)) * (x3 - x2) /
            sqrt(x2 * x2 - 2 * x2 * x3 + x3 * x3 + y2 * y2 - 2 * y2 * y3 +
                 y3 * y3) +
        (2 * (y2 - y5)) * (y3 - y2) /
            sqrt(x2 * x2 - 2 * x2 * x3 + x3 * x3 + y2 * y2 - 2 * y2 * y3 +
                 y3 * y3);
    e = (x2 - x5) * (x2 - x5) + (y2 - y5) * (y2 - y5);
    double min1 =
        acos((a * length + b) / sqrt(c * length * length + d * length + e)) /
        w[i] / length;
    for (int j = 1; j < 100; j++) {
      double x = length * j / 100;
      double min2 = acos((a * x + b) / sqrt(c * x * x + d * x + e)) / w[i] / x;
      if (min2 < min1) min1 = min2;
    }
    miny[i] = 1 / min1;
  }
  miny[n] = 0;
  std::sort(miny, miny + n);
  printf("%.4f", miny[k]);
}
