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>
#pragma comment(linker, "/STACK:60777216")
using namespace std;
double xa, ya, xb, yb;
int n;
double x[11111], y[11111], a[11111], w[11111];
int k;
const double pi = acos(-1.);
bool check(double v, double a, double w) {
  int num = 10;
  for (int i(0); i < (num + 1); ++i) {
    double x = xa + (xb - xa) * i / double(num);
    double y = ya + (yb - ya) * i / double(num);
    double q = atan2(y, x) - a;
    if (q > 2 * pi) q -= 2 * pi;
    while (q < 0) q += 2 * pi;
    if (q > 2 * pi - q) q = 2 * pi - q;
    if (hypot(x - xa, y - ya) / v >= (w < 1e-5 ? (i == 0 ? 0 : 1e10) : q / w))
      return 1;
  }
  return 0;
}
bool good(double s) {
  int num = 0;
  for (int i(0); i < (n); ++i) {
    xa -= x[i], ya -= y[i], xb -= x[i], yb -= y[i];
    if (check(s, a[i], w[i])) num++;
    xa += x[i], ya += y[i], xb += x[i], yb += y[i];
  }
  return num <= k;
}
int main() {
  cin >> xa >> ya >> xb >> yb >> n;
  for (int i(0); i < (n); ++i)
    scanf("%lf %lf %lf %lf", x + i, y + i, a + i, w + i);
  cin >> k;
  double a = 0, b = 1e6, best = 1e6;
  for (int i(0); i < (40); ++i) {
    double s = (a + b) / 2;
    if (good(s))
      best = s, b = s;
    else
      a = s;
  }
  printf("%.4lf\n", best);
  return 0;
}
