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 = 3.1415926535897932384626433832795;
struct vec {
  vec() : x(0), y(0) {}
  vec(double _x, double _y) : x(_x), y(_y) {}
  double x, y;
  vec operator+(const vec& r) const { return vec(x + r.x, y + r.y); }
  vec operator-(const vec& r) const { return vec(x - r.x, y - r.y); }
};
double cross(const vec& a, const vec& b) { return a.x * b.y - b.x * a.y; }
double dot(const vec& a, const vec& b) { return a.x * b.x + a.y * b.y; }
double len(const vec& v) { return sqrt(v.x * v.x + v.y * v.y); }
struct tank {
  vec p;
  double a, w;
  double tA, tB;
  double fi0;
};
double norm(double a) { return a < 0 ? 2 * PI + a : a; }
double calc_rot_time(const tank& t, const vec& p) {
  double angle = norm(atan2(p.y - t.p.y, p.x - t.p.x));
  return min(fabs(angle - t.a),
             min(angle, 2 * PI - angle) + min(t.a, 2 * PI - t.a)) /
         t.w;
}
double l;
int K;
vector<tank> tanks;
bool can(double v) {
  double t1 = l / v;
  int hits = 0;
  for (int i = 0; i < tanks.size() && hits <= K; i++) {
    if (tanks[i].tB < t1 - 1E-7)
      hits++;
    else if (tanks[i].tA < t1) {
      double x =
          tanks[i].p.x -
          tanks[i].p.y * tan(tanks[i].fi0 - tanks[i].w * (t1 - tanks[i].tA));
      if (v == 8) {
      }
      if (x > l + 1E-7) hits++;
    }
  }
  return hits <= K;
}
int main() {
  vec A, B;
  cin >> A.x >> A.y >> B.x >> B.y;
  int N;
  cin >> N;
  tanks.resize(N);
  l = len(B - A);
  double dy = (B - A).y;
  double dx = (B - A).x;
  double v = atan2(dy, dx);
  double da = norm(v);
  for (int i = 0; i < N; i++) {
    cin >> tanks[i].p.x >> tanks[i].p.y >> tanks[i].a >> tanks[i].w;
    double new_x = dot(tanks[i].p - A, B - A) / l;
    double new_y = cross(B - A, tanks[i].p - A) / l;
    double new_a = tanks[i].a - da;
    while (new_a < 0) new_a += 2 * PI;
    while (new_a >= 2 * PI) new_a -= 2 * PI;
    tanks[i].p = vec(new_x, new_y);
    tanks[i].a = new_a;
    tanks[i].tA = calc_rot_time(tanks[i], vec(0, 0));
    tanks[i].tB = calc_rot_time(tanks[i], vec(l, 0));
    tanks[i].fi0 = atan2(tanks[i].p.x, abs(tanks[i].p.y));
  }
  cin >> K;
  double v_low = 0;
  double v_high = 1;
  while (!can(v_high)) v_high *= 2;
  while (v_high - v_low > 1E-5) {
    double mid = (v_high + v_low) / 2;
    if (can(mid))
      v_high = mid;
    else
      v_low = mid;
  }
  cout << fixed << setprecision(5) << (v_high + v_low) / 2 << endl;
}
