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;
struct point {
  long double x, y;
  point(long double _x = 0, long double _y = 0) {
    x = _x;
    y = _y;
  }
  long double dist() { return sqrt(x * x + y * y); }
  point operator+(point w) { return point(x + w.x, y + w.y); }
  point operator-(point w) { return point(x - w.x, y - w.y); }
};
long double sp(point a, point b) { return (a.x * b.x + a.y * b.y); }
long double vp(point a, point b) { return (a.x * b.y - a.y * b.x); }
long double angle(point a, point b) {
  long double COS = sp(a, b) / (a.dist() * b.dist());
  if (COS < -1.0) COS = -1.0;
  if (COS > 1.0) COS = 1.0;
  return acos(COS);
}
struct prava {
  long double a, b, c;
  prava(point f = point(0, 0), point t = point(1, 1)) {
    a = t.y - f.y;
    b = f.x - t.x;
    c = t.x * f.y - f.x * t.y;
  }
  void rot() {
    swap(a, b);
    a *= -1;
  }
  void pass(point w) { c = -a * w.x - b * w.y; }
  point IP(prava w) {
    point ret;
    if (fabs(a) < 1E-8) {
      ret.y = (-c) / b;
      ret.x = (-w.b * ret.y - w.c) / w.a;
    } else {
      ret.y = (w.a * c - a * w.c) / (a * w.b - w.a * b);
      ret.x = (-b * ret.y - c) / a;
    }
    return ret;
  }
};
bool is_between(point f, point t, point w) {
  return (sp(t - f, w - f) > -1E-8);
}
point perp(point F, point T, point from) {
  prava P1, P2;
  P1 = prava(F, T);
  P2 = P1;
  P2.rot();
  P2.pass(from);
  point PT = P1.IP(P2);
  if (is_between(F, T, PT))
    return PT;
  else
    return T;
}
long double ANG_TO_POINT(point f, point t, long double start) {
  double ang = atan2(t.y - f.y, t.x - f.x);
  ang = fabs(ang - start);
  while (ang >= 2 * M_PI) ang -= 2 * M_PI;
  return min(ang, 2 * M_PI - ang);
}
int n, K;
point A, B, tank[10000];
long double sr[10000], vr[10000];
long double V = 1;
long double get_d(long double& alp, long double beta, long double& AP) {
  return (AP * sin(beta)) / sin(alp + beta);
}
bool kills(point P, long double rot, long double rot_v) {
  long double AP = (P - A).dist();
  if (ANG_TO_POINT(P, B, rot) <= rot_v * ((B - A).dist() / V)) return true;
  point Bp = perp(A, B, P);
  long double ST_T = ANG_TO_POINT(P, A, rot) / rot_v;
  long double alp = angle((B - A), (P - A));
  long double LE = ST_T, RE = min((Bp - A).dist() / V,
                                  min(2 * M_PI - M_PI / 2 - alp,
                                      2 * M_PI - alp - angle(A - B, P - B)) /
                                      rot_v);
  if (LE > RE) return false;
  while (RE - LE > 1E-6) {
    long double mp1 = (2 * LE + RE) / 3, mp2 = (LE + 2 * RE) / 3;
    long double d1 = V * mp1 - get_d(alp, (mp1 - ST_T) * rot_v, AP),
                d2 = V * mp2 - get_d(alp, (mp2 - ST_T) * rot_v, AP);
    if (d1 < d2)
      RE = mp2;
    else
      LE = mp1;
  }
  long double mp = (LE + RE) / 2;
  long double dm = V * mp - get_d(alp, (mp - ST_T) * rot_v, AP);
  return (dm <= 0.0);
}
bool TRY(long double _V) {
  V = _V;
  int br = 0;
  for (int i = 0; i < n; ++i)
    if (kills(tank[i], sr[i], vr[i])) ++br;
  return (br <= K);
}
int main() {
  int i, j, k, l;
  cin >> A.x >> A.y >> B.x >> B.y;
  cin >> n;
  for (i = 0; i < n; ++i) cin >> tank[i].x >> tank[i].y >> sr[i] >> vr[i];
  cin >> K;
  long double LE = 0.000001, RE = 4E9;
  while (RE - LE > 0.000001) {
    long double M = (LE + RE) / 2;
    if (TRY(M))
      RE = M;
    else
      LE = M;
  }
  printf("%.12lf\n", (double)((LE + RE) / 2));
  return 0;
}
