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 double pi = acos(-1);
struct pnt {
  double x, y;
  pnt(double x = 0, double y = 0) : x(x), y(y) {}
  pnt operator+(pnt a) { return pnt(x + a.x, y + a.y); }
  pnt operator-(pnt a) { return pnt(x - a.x, y - a.y); }
  pnt operator/(double a) { return pnt(x / a, y / a); }
  pnt operator*(double a) { return pnt(x * a, y * a); }
  double operator^(pnt a) { return x * a.y - y * a.x; }
  double operator&(pnt a) { return x * a.x + y * a.y; }
  double dist() { return sqrt(x * x + y * y); }
  void input() { scanf("%lf %lf", &x, &y); }
  void print() { printf("%lf %lf\n", x, y); }
} pos[100010], A, B;
double vec[100010], a[100010], w[100010];
int n;
double angle(pnt b, pnt a, pnt c) {
  return acos((b - a & c - a) / (c - a).dist() / (b - a).dist());
}
double D;
int P;
double f(double x, int i, double d, double t, double dl, double v, double al) {
  return dl + v * x - d * sin(w[i] * x) / sin(al + w[i] * x);
}
bool check(double v) {
  int tot = 0;
  for (int i = 0; i < n; i++) {
    if (tot > P) return 0;
    pnt tp = pnt(cos(a[i]), sin(a[i]));
    double t = angle(pos[i] + tp, pos[i], B) / w[i];
    if (v * t < D) {
      tot++;
      continue;
    }
    t = angle(pos[i] + tp, pos[i], A) / w[i];
    if (v * t > D - 1e-7) continue;
    double al = angle(pos[i], A, B);
    if (al > pi / 2 - 1e-7) continue;
    double d = (pos[i] - A).dist();
    double T = (D - v * t) / v, dl = v * t;
    double st = 0, en = T;
    while (st < en - 1e-7) {
      double x = (2 * st + en) / 3, y = (st + 2 * en) / 3;
      if (f(x, i, d, t, dl, v, al) < f(y, i, d, t, dl, v, al))
        en = y;
      else
        st = x;
    }
    if (f(st, i, d, t, dl, v, al) < 1e-7) tot++;
  }
  if (tot > P) return 0;
  return 1;
}
int main() {
  A.input(), B.input();
  D = (A - B).dist();
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    pos[i].input();
    cin >> a[i] >> w[i];
  }
  scanf("%d", &P);
  double l = 0, r = 1e9;
  while (l < r - 1e-7) {
    double mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  printf("%.12lf\n", l);
}
