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;
template <class T>
void pv(T a, T b) {
  for (T i = a; i != b; ++i) cout << *i << " ";
  cout << endl;
}
template <class T>
void pvp(T a, T b) {
  for (T i = a; i != b; ++i)
    cout << "(" << i->first << ", " << i->second << ") ";
  cout << endl;
}
void chmin(int &t, int f) {
  if (t > f) t = f;
}
void chmax(int &t, int f) {
  if (t < f) t = f;
}
void chmin(long long &t, long long f) {
  if (t > f) t = f;
}
void chmax(long long &t, long long f) {
  if (t < f) t = f;
}
void chmin(double &t, double f) {
  if (t > f) t = f;
}
void chmax(double &t, double f) {
  if (t < f) t = f;
}
int in_c() {
  int c;
  for (; (c = getchar()) <= ' ';) {
    if (!~c) throw ~0;
  }
  return c;
}
int in() {
  int x = 0, c;
  for (; (unsigned)((c = getchar()) - '0') >= 10;) {
    if (c == '-') return -in();
    if (!~c) throw ~0;
  }
  do {
    x = (x << 3) + (x << 1) + (c - '0');
  } while ((unsigned)((c = getchar()) - '0') < 10);
  return x;
}
long long In() {
  long long x = 0, c;
  for (; (unsigned)((c = getchar()) - '0') >= 10;) {
    if (c == '-') return -In();
    if (!~c) throw ~0;
  }
  do {
    x = (x << 3) + (x << 1) + (c - '0');
  } while ((unsigned)((c = getchar()) - '0') < 10);
  return x;
}
double EPS = 1e-10;
const double INF = 1e+10;
const double PI = acos(-1.0);
int sig(double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; }
struct Pt {
  double x, y;
  Pt() {}
  Pt(double x, double y) : x(x), y(y) {}
  Pt operator+(const Pt &a) const { return Pt(x + a.x, y + a.y); }
  Pt operator-(const Pt &a) const { return Pt(x - a.x, y - a.y); }
  Pt operator*(const Pt &a) const {
    return Pt(x * a.x - y * a.y, x * a.y + y * a.x);
  }
  Pt operator-() const { return Pt(-x, -y); }
  Pt operator*(const double &k) const { return Pt(x * k, y * k); }
  Pt operator/(const double &k) const { return Pt(x / k, y / k); }
  double abs() const { return sqrt(x * x + y * y); }
  double abs2() const { return x * x + y * y; }
  double arg() const { return atan2(y, x); }
  double dot(const Pt &a) const { return x * a.x + y * a.y; }
  double det(const Pt &a) const { return x * a.y - y * a.x; }
  bool operator<(const Pt &a) const {
    return (x != a.x) ? (x < a.x) : (y < a.y);
  }
  bool operator==(const Pt &a) const {
    return (sig(x - a.x) == 0 && sig(y - a.y) == 0);
  }
};
ostream &operator<<(ostream &os, const Pt &a) {
  os << "(" << a.x << ", " << a.y << ")";
  return os;
}
double tri(Pt a, Pt b, Pt c) { return (b - a).det(c - a); }
Pt proj(Pt a, Pt b) { return a * a.dot(b) / a.abs2(); }
Pt perp(Pt a, Pt b, Pt c) { return a + proj(b - a, c - a); }
Pt refl(Pt a, Pt b, Pt c) { return perp(a, b, c) * 2 - c; }
Pt A, B;
int N, K;
Pt P[10010];
double T[10010], W[10010];
double angle_dif(double a, double b) {
  double ret = fmod(fmod(b - a, PI * 2.0) + PI * 2.0, PI * 2.0);
  return min(ret, PI * 2.0 - ret);
}
bool shoot(int i, double v) {
  Pt p = P[i];
  double t = T[i], w = W[i];
  double ta = (A - p).arg(), tb = (B - p).arg();
  if (angle_dif(t, tb) / w < (B - A).abs() / v) {
    return 1;
  }
  Pt C = perp(A, B, p);
  if ((B - A).dot(C - A) < 0) C = A;
  if ((A - B).dot(C - B) < 0) C = B;
  double t0 = angle_dif(t, ta);
  for (int ph = 0; ph < 2; ++ph) {
    Pt a = ph ? B : A;
    Pt b = ph ? C : B;
    double ka = (a - A).abs() / v;
    double kb = (b - A).abs() / v;
    double lo = 0.0, ho = 1.0;
    for (int reps = 40; reps--;) {
      double mol = (lo + lo + ho) / 3.0;
      double moh = (lo + ho + ho) / 3.0;
      Pt pl = a + (b - a) * mol;
      Pt pr = a + (b - a) * moh;
      double kl = ka + (kb - ka) * mol;
      double kr = ka + (kb - ka) * moh;
      double thl = t0 + angle_dif(ta, (pl - p).arg()) - w * kl;
      double thr = t0 + angle_dif(ta, (pr - p).arg()) - w * kr;
      if (ph) {
        (thl > thr) ? (lo = mol) : (ho = moh);
      } else {
        (thl > thr) ? (lo = mol) : (ho = moh);
      }
    }
    double mo = (lo + ho) / 2.0;
    Pt pm = a + (b - a) * mo;
    if ((t0 + angle_dif(ta, (pm - p).arg())) / w < (pm - A).abs() / v) {
      return 1;
    }
  }
  return 0;
}
int main() {
  int i;
  for (; ~scanf("%lf%lf%lf%lf", &A.x, &A.y, &B.x, &B.y);) {
    N = in();
    for (i = 0; i < N; ++i) {
      scanf("%lf%lf%lf%lf", &P[i].x, &P[i].y, &T[i], &W[i]);
    }
    K = in();
    double lo = 0.0, ho = 1e+7;
    for (int reps = 40; reps--;) {
      double mo = (lo + ho) / 2.0;
      int cnt = 0;
      for (i = 0; i < N; ++i) {
        if (shoot(i, mo)) {
          ++cnt;
        }
      }
      (cnt <= K) ? (ho = mo) : (lo = mo);
    }
    printf("%.10f\n", ho);
  }
  return 0;
}
