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 pi2 = acos(-1.0) * 2;
double g(double x, double y, double a, double v) {
  double c = atan2(y, x) - a;
  if (c < 0) c += pi2;
  return min(c, pi2 - c);
}
double f(double x0, double y0, double x1, double y1, double a, double v) {
  double dx = x1 - x0, dy = y1 - y0, d = sqrt(dx * dx + dy * dy);
  double res = 1 / g(x1, y1, a, v);
  for (double t = 1e-4; t < 1; t += 2e-4)
    res = max(res, t / g(x0 + dx * t, y0 + dy * t, a, v));
  double L = 1e-4, R = 1, l, r, fl, fr;
  for (int k(0); k < 256; ++k) {
    l = (L * 2 + R) / 3;
    r = (L + R * 2) / 3;
    fl = l / g(x0 + dx * l, y0 + dy * l, a, v);
    fr = r / g(x0 + dx * r, y0 + dy * r, a, v);
    if (fl < fr) {
      res = max(res, fr);
      L = l;
    } else {
      res = max(res, fl);
      R = r;
    }
  }
  return d * res;
}
int main() {
  double Ax, Ay, Bx, By;
  int n;
  cin >> Ax >> Ay >> Bx >> By >> n;
  vector<double> v;
  for (int i(0); i < n; ++i) {
    double x, y, a, w;
    scanf("%lf%lf%lf%lf", &x, &y, &a, &w);
    v.push_back(f(Ax - x, Ay - y, Bx - x, By - y, a, w));
  }
  sort(v.rbegin(), v.rend());
  v.push_back(0);
  int k;
  cin >> k;
  printf("%.12lf\n", v[k]);
  return 0;
}
