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, 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++) {
    theta = atan2(en.y - tank[i].y, en.x - tank[i].x);
    rtheta = theta;
    while (theta < tank[i].a - eps) theta += 2 * pi;
    theta -= tank[i].a;
    if (theta > pi) theta = 2 * pi - theta;
    now_t = theta / tank[i].w;
    if (v * now_t <
        sqrt((en.x - st.x) * (en.x - st.x) + (en.y - st.y) * (en.y - st.y))) {
      nk++;
      continue;
    }
    ltheta = atan2(st.y - tank[i].y, st.x - tank[i].x);
    theta = ltheta;
    while (theta < tank[i].a - eps) theta += 2 * pi;
    theta -= tank[i].a;
    if (theta > pi) theta = 2 * pi - theta;
    now_t = theta / tank[i].w;
    if (v * now_t >
        sqrt((en.x - st.x) * (en.x - st.x) + (en.y - st.y) * (en.y - st.y)))
      continue;
    if (ltheta < 0) ltheta = -ltheta;
    if (rtheta < 0) rtheta = -rtheta;
    if (ltheta > rtheta) swap(ltheta, rtheta);
    if (tank[i].w == 0)
      continue;
    else {
      while (ltheta < tank[i].a - eps) ltheta += 2 * pi;
      ltheta -= tank[i].a;
      if (ltheta > pi) ltheta = 2 * pi - ltheta;
      theta = atan2(en.y - st.y, en.x - st.x);
      low = ltheta / tank[i].w;
      high = T;
      if (low > high) continue;
      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 < eps && bs > -eps) || (fs > -eps && bs < eps)) {
        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 < eps) || (fs < 0 && fx > -eps)) {
        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;
}
