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.00), eps = 1e-9;
struct point {
  double x, y, w, a;
};
point st, en, tank[11111];
int n, k;
void norm(double &theta) {
  while (theta < -pi + eps) theta += 2 * pi;
  while (theta > pi + eps) theta -= 2 * pi;
}
bool check(double v) {
  int i, j, s, p, q, nk = 0, it;
  double now_t, theta, dist, T;
  double ltheta, rtheta, dtheta, low, high, mid, mt, vs, fs, bs, mx, my, fx, fy;
  bool ft;
  dist = sqrt((en.x - st.x) * (en.x - st.x) + (en.y - st.y) * (en.y - st.y));
  T = dist / v;
  for (i = 0; i < n; i++) {
    double ds = ((tank[i].x - st.x) * (en.y - st.y) -
                 (tank[i].y - st.y) * (en.x - st.x));
    if (fabs(ds) < eps) {
      bool fk = false;
      if (tank[i].x <= max(st.x, en.x) + eps &&
          tank[i].x >= min(st.x, en.x) - eps &&
          tank[i].y <= max(st.y, en.y) + eps &&
          tank[i].y >= min(st.y, en.y) - eps)
        fk = true;
      if (fk) {
        nk++;
        continue;
      }
    }
    theta = atan2(en.y - tank[i].y, en.x - tank[i].x);
    rtheta = theta;
    ltheta = atan2(st.y - tank[i].y, st.x - tank[i].x);
    if (ltheta > rtheta)
      dtheta = rtheta + 2 * pi - ltheta;
    else
      dtheta = rtheta - ltheta;
    ft = false;
    if (dtheta > pi) swap(ltheta, rtheta);
    if (ltheta < rtheta + eps) {
      if (tank[i].a < rtheta + eps && tank[i].a > ltheta - eps) ft = true;
    } else {
      if (tank[i].a < rtheta + eps || tank[i].a > ltheta - eps) ft = true;
    }
    if (tank[i].w == 0) {
      if (ft) nk++;
      continue;
    } else {
      while (ltheta < tank[i].a - eps) ltheta += 2 * pi;
      while (rtheta < tank[i].a - eps) rtheta += 2 * pi;
      theta = atan2(en.y - st.y, en.x - st.x);
      low = (ltheta - tank[i].a) / tank[i].w;
      high = min((rtheta - tank[i].a) / tank[i].w, T);
      if (ltheta > rtheta) low = 0;
      if (low < high + eps) {
        mt = low;
        fs = (st.x + v * cos(theta) * mt - tank[i].x) *
                 sin(tank[i].a + tank[i].w * mt) -
             (st.y + v * sin(theta) * mt - tank[i].y) *
                 cos(tank[i].a + tank[i].w * mt);
        mt = high;
        bs = (st.x + v * cos(theta) * mt - tank[i].x) *
                 sin(tank[i].a + tank[i].w * mt) -
             (st.y + v * sin(theta) * mt - tank[i].y) *
                 cos(tank[i].a + tank[i].w * mt);
        if ((fs < 1e-4 && bs > -1e-4) || (fs > -1e-4 && bs < 1e-4)) {
          nk++;
          continue;
        }
        for (it = 0; it < 100; it++) {
          mx = mt = (2 * low + high) / 3.;
          fx = (st.x + v * cos(theta) * mt - tank[i].x) *
                   sin(tank[i].a + tank[i].w * mt) -
               (st.y + v * sin(theta) * mt - tank[i].y) *
                   cos(tank[i].a + tank[i].w * mt);
          my = mt = (low + 2 * high) / 3.;
          fy = (st.x + v * cos(theta) * mt - tank[i].x) *
                   sin(tank[i].a + tank[i].w * mt) -
               (st.y + v * sin(theta) * mt - tank[i].y) *
                   cos(tank[i].a + tank[i].w * mt);
          if ((fs > 0 && fx > fy) || (fs < 0 && fx < fy))
            low = mx;
          else
            high = my;
        }
        mt = 0.5 * (low + high);
        fx = (st.x + v * cos(theta) * mt - tank[i].x) *
                 sin(tank[i].a + tank[i].w * mt) -
             (st.y + v * sin(theta) * mt - tank[i].y) *
                 cos(tank[i].a + tank[i].w * mt);
        if ((fs > 0 && fx < 1e-4) || (fs < 0 && fx > -1e-4)) {
          nk++;
          continue;
        }
      }
      if (ltheta > rtheta) {
        low = (ltheta - tank[i].a) / tank[i].w;
        high = min(T, (rtheta + 2 * pi - tank[i].a) / tank[i].w);
        if (low < high + eps) {
          mt = low;
          fs = (st.x + v * cos(theta) * mt - tank[i].x) *
                   sin(tank[i].a + tank[i].w * mt) -
               (st.y + v * sin(theta) * mt - tank[i].y) *
                   cos(tank[i].a + tank[i].w * mt);
          mt = high;
          bs = (st.x + v * cos(theta) * mt - tank[i].x) *
                   sin(tank[i].a + tank[i].w * mt) -
               (st.y + v * sin(theta) * mt - tank[i].y) *
                   cos(tank[i].a + tank[i].w * mt);
          if ((fs < 1e-4 && bs > -1e-4) || (fs > -1e-4 && bs < 1e-4)) {
            nk++;
            continue;
          }
          for (it = 0; it < 100; it++) {
            double mx, my, fx, fy;
            mx = mt = (2 * low + high) / 3.;
            fx = (st.x + v * cos(theta) * mt - tank[i].x) *
                     sin(tank[i].a + tank[i].w * mt) -
                 (st.y + v * sin(theta) * mt - tank[i].y) *
                     cos(tank[i].a + tank[i].w * mt);
            my = mt = (low + 2 * high) / 3.;
            fy = (st.x + v * cos(theta) * mt - tank[i].x) *
                     sin(tank[i].a + tank[i].w * mt) -
                 (st.y + v * sin(theta) * mt - tank[i].y) *
                     cos(tank[i].a + tank[i].w * mt);
            if ((fs > 0 && fx > fy) || (fs < 0 && fx < fy))
              low = mx;
            else
              high = my;
          }
          mt = 0.5 * (low + high);
          fx = (st.x + v * cos(theta) * mt - tank[i].x) *
                   sin(tank[i].a + tank[i].w * mt) -
               (st.y + v * sin(theta) * mt - tank[i].y) *
                   cos(tank[i].a + tank[i].w * mt);
          if ((fs > 0 && fx < 1e-4) || (fs < 0 && fx > -1e-4)) {
            nk++;
            continue;
          }
        }
      }
    }
    if (nk > k) return false;
  }
  return nk <= k;
}
int main() {
  int i, j, s, p, q;
  double low, high, mid;
  scanf("%lf%lf%lf%lf", &st.x, &st.y, &en.x, &en.y);
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%lf%lf%lf%lf", &tank[i].x, &tank[i].y, &tank[i].a, &tank[i].w);
    norm(tank[i].a);
  }
  scanf("%d", &k);
  low = 0;
  high = 1e9;
  while (low < high - eps) {
    mid = (low + high) * 0.5;
    if (check(mid))
      high = mid;
    else
      low = mid + eps;
  }
  printf("%.20f\n", (low + high) * 0.5);
  return 0;
}
