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);
const int N = 10005;
const double eps = 1e-8;
const double INF = 1e20;
struct TPoint {
  double x, y;
  TPoint operator<<(double angle) {
    TPoint ret;
    ret.x = x * cos(angle) - y * sin(angle);
    ret.y = y * cos(angle) + x * sin(angle);
    return ret;
  }
  TPoint operator>>(double angle) {
    TPoint ret;
    return ret << (2 * pi - angle);
  }
  TPoint operator-(TPoint oth) {
    TPoint ret;
    ret.x = x - oth.x;
    ret.y = y - oth.y;
    return ret;
  }
  TPoint operator+(TPoint oth) {
    TPoint ret;
    ret.x = x + oth.x;
    ret.y = y + oth.y;
    return ret;
  }
  double operator^(TPoint oth) { return x * oth.y - y * oth.x; }
  double operator*(TPoint oth) { return x * oth.x + y * oth.y; }
};
struct TLine {
  double a, b, c;
};
int sign(double x) {
  if (x < -eps) return -1;
  if (x > eps) return 1;
  return 0;
}
TLine Get_Line(TPoint A, TPoint B) {
  TLine ret;
  ret.a = A.y - B.y;
  ret.b = B.x - A.x;
  ret.c = A.x * B.y - A.y * B.x;
  return ret;
}
TPoint jiao(TLine A, TLine B) {
  TPoint ret;
  double tmp = A.a * B.b - A.b * B.a;
  ret.x = (A.b * B.c - A.c * B.b) / tmp;
  ret.y = (A.c * B.a - A.a * B.c) / tmp;
  return ret;
}
double dis(TPoint A, TPoint B) {
  return sqrt((A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y));
}
double fix(double angle) {
  if (sign(angle) == 0) return 0;
  while (angle < 0) angle += 2 * pi;
  while (angle >= 2 * pi) angle -= 2 * pi;
  return angle;
}
double fix2(double angle) {
  while (angle <= -pi) angle += 2 * pi;
  while (angle > pi) angle -= 2 * pi;
  return angle;
}
double Get_Angle(TPoint dir) {
  double ret = atan2(dir.y, dir.x);
  return fix(ret);
}
double Cross_Angle(double A, double B) { return min(fix(A - B), fix(B - A)); }
TPoint make_point(double angle) {
  TPoint ret;
  ret.x = cos(angle);
  ret.y = sin(angle);
  return ret;
}
int n, Limit;
TPoint A, B;
TLine AB;
struct Tanks {
  double a, w;
  TPoint center;
} tank[N];
double Ans[N];
void read_data() {
  scanf("%lf %lf %lf %lf", &A.x, &A.y, &B.x, &B.y);
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    scanf("%lf %lf %lf %lf", &tank[i].center.x, &tank[i].center.y, &tank[i].a,
          &tank[i].w);
  scanf("%d", &Limit);
  AB = Get_Line(A, B);
}
bool can_escape(double v, int k) {
  TPoint C = tank[k].center;
  double Time = Cross_Angle(tank[k].a, Get_Angle(A - C)) / tank[k].w;
  TPoint dir = B - A;
  TPoint D;
  double vertical_angle = Get_Angle(D - C);
  double angle_l, angle_r;
  if (sign((B - A) ^ (C - A)) > 0) {
    D = C + (dir >> (pi / 2));
    angle_l = fix2(Get_Angle(A - C) - vertical_angle);
    angle_r = fix2(Get_Angle(B - C) - vertical_angle);
    TLine CD = Get_Line(C, D);
    TPoint cross = jiao(AB, CD);
    double L = dis(cross, C);
    double S = dis(A, B) - dis(cross, B);
    double cc = sqrt(L / v);
    if (sign(cc - 1) > 0) {
      Time = Cross_Angle(tank[k].a, Get_Angle(B - C)) / tank[k].w;
      return dis(A, B) / Time <= v;
    }
    if (cc > 1) cc = 1;
    if (cc < 0) cc = 0;
    double angle = acos(cc);
    bool ret = true;
    if (sign(angle_l - angle) <= 0 && sign(angle - angle_r) <= 0) {
      double T_Time = Time + Cross_Angle(angle_l, cc) / tank[k].w;
      double Len = S + L * tan(cc);
      if (Len / T_Time > v) ret = false;
    }
    angle = -angle;
    if (sign(angle_l - angle) <= 0 && sign(angle - angle_r) <= 0) {
      double T_Time = Time + Cross_Angle(angle_l, cc) / tank[k].w;
      double Len = S + L * tan(cc);
      if (Len / T_Time > v) ret = false;
    }
    return ret;
  } else {
    D = C + (dir << (pi / 2));
    angle_l = fix2(vertical_angle - Get_Angle(A - C));
    angle_r = fix2(vertical_angle - Get_Angle(B - C));
    TLine CD = Get_Line(C, D);
    TPoint cross = jiao(AB, CD);
    double L = dis(cross, C);
    double S = dis(A, B) - dis(cross, B);
    double cc = sqrt(L / v);
    if (sign(cc - 1) > 0) {
      Time = Cross_Angle(tank[k].a, Get_Angle(B - C)) / tank[k].w;
      return dis(A, B) / Time <= v;
    }
    if (cc > 1) cc = 1;
    if (cc < 0) cc = 0;
    double angle = acos(cc);
    bool ret = true;
    if (sign(angle_l - angle) <= 0 && sign(angle - angle_r) <= 0) {
      double T_Time = Time + Cross_Angle(angle_l, cc) / tank[k].w;
      double Len = S + L * tan(cc);
      if (Len / T_Time > v) ret = false;
    }
    angle = -angle;
    if (sign(angle_l - angle) <= 0 && sign(angle - angle_r) <= 0) {
      double T_Time = Time + Cross_Angle(angle_l, cc) / tank[k].w;
      double Len = S + L * tan(cc);
      if (Len / T_Time > v) ret = false;
    }
    return ret;
  }
}
void solve(int k) {
  double ans = 0;
  TPoint C = tank[k].center;
  double Time = Cross_Angle(Get_Angle(B - C), tank[k].a) / tank[k].w;
  ans = max(ans, dis(A, B) / Time);
  double l = 0, r = INF, mid;
  while (r - l > eps) {
    mid = (l + r) / 2;
    if (can_escape(mid, k))
      r = mid;
    else
      l = mid;
  }
  ans = max(ans, l);
  Ans[k] = ans;
}
int main() {
  read_data();
  for (int i = 1; i <= n; i++) solve(i);
  Ans[0] = 0;
  sort(Ans + 1, Ans + n + 1);
  printf("%.6lf\n", Ans[n - Limit]);
}
