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;
double prodvec(complex<double> p1, complex<double> p2) {
  return imag(conj(p1) * p2);
}
double prodesc(complex<double> p1, complex<double> p2) {
  return real(conj(p1) * p2);
}
const int limite = 20000;
double error = 1e-7;
double computa(complex<double> p, complex<double> direccion, double w,
               double b) {
  complex<double> pb(b, 0);
  double tb = abs(arg((pb - p) / direccion)) / w;
  double sol = b / tb;
  double x = real(p);
  double y = imag(p);
  if (x <= 0) return sol;
  double inf = sol;
  double sup = 1000000000;
  while (inf + error < sup) {
    double med = (inf + sup) / 2.0;
    if (med * y / w < y * y) {
      sup = med;
    } else {
      complex<double> corte(x - sqrt(med * y / w - y * y), 0.0);
      if (real(corte) < 0 or real(corte) > b)
        sup = med;
      else {
        double t = abs(arg((corte - p) / direccion)) / w;
        double tt = real(corte) / med;
        if (tt < t)
          sup = med;
        else
          inf = med;
      }
    }
  }
  return inf;
}
complex<double> pa, pb;
int n;
complex<double> p[100000];
complex<double> vp[100000];
double w[100000];
int k;
complex<double> leer() {
  double x, y;
  cin >> x >> y;
  return complex<double>(x, y);
}
int main() {
  cout.setf(ios::fixed);
  cout.precision(10);
  pa = leer();
  pb = leer();
  complex<double> divi = pb - pa;
  divi = divi / abs(divi);
  cin >> n;
  vector<double> v;
  for (int i = 0; i < n; i++) {
    p[i] = leer();
    double a;
    cin >> a;
    vp[i] = polar(1.0, a);
    cin >> w[i];
    p[i] -= pa;
    p[i] = p[i] / divi;
    vp[i] = vp[i] / divi;
    if (imag(p[i]) < 0) {
      p[i] = conj(p[i]);
      vp[i] = conj(vp[i]);
    }
    v.push_back(computa(p[i], vp[i], w[i], abs(pb - pa)));
  }
  cin >> k;
  sort(v.begin(), v.end());
  if (k >= int(v.size()))
    cout << 0.0 << endl;
  else
    cout << v[k] << endl;
}
