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>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const double eps = 1e-6;
const double eps2 = 1e-4;
const double pi = 2.0 * acos(0.0);
double xa, ya, xb, yb;
double d;
double ang;
double dist(double x1, double y1, double x2, double y2) {
  double dx = x1 - x2;
  double dy = y1 - y2;
  return sqrt(dx * dx + dy * dy);
}
double getValue(double t, double v, double x, double y, double a, double w) {
  double nx = xa + t * v * cos(ang);
  double ny = ya + t * v * sin(ang);
  double nang = atan2(ny - y, nx - x);
  double diff = fabs(a - nang);
  while (diff >= 2.0 * pi) {
    diff -= 2.0 * pi;
  }
  while (diff < 0) {
    diff += 2.0 * pi;
  }
  diff = min(diff, 2.0 * pi - diff);
  return diff - t * w;
}
bool canCatch(double v, double x, double y, double a, double w) {
  double shift = d / 10.0 / v;
  for (int steps = 0; steps < 10; ++steps) {
    double left_bound = (double)(steps)*shift,
           right_bound = (double)(steps + 1) * shift;
    for (int i = 0; i < 30 && right_bound - left_bound > eps2; ++i) {
      double mleft = (2.0 * left_bound + right_bound) / 3.0;
      double mright = (left_bound + 2.0 * right_bound) / 3.0;
      double vleft = getValue(mleft, v, x, y, a, w);
      double vright = getValue(mright, v, x, y, a, w);
      if (vleft < vright) {
        right_bound = mright;
      } else {
        left_bound = mleft;
      }
    }
    if (getValue(left_bound, v, x, y, a, w) < eps) {
      return true;
    }
  }
  return false;
}
double calc(double x, double y, double a, double w) {
  int steps = 50;
  double left_bound = 0.0, right_bound = 1e10;
  for (int i = 0; i < 50 && right_bound - left_bound > eps2; ++i) {
    double middle = (left_bound + right_bound) / 2.0;
    if (canCatch(middle, x, y, a, w)) {
      left_bound = middle;
    } else {
      right_bound = middle;
    }
  }
  return left_bound;
}
int main() {
  cin >> xa >> ya >> xb >> yb;
  d = dist(xa, ya, xb, yb);
  ang = atan2(yb - ya, xb - xa);
  vector<double> res;
  res.push_back(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    double x, y, a, w;
    cin >> x >> y >> a >> w;
    res.push_back(calc(x, y, a, w));
  }
  int k;
  cin >> k;
  sort(res.rbegin(), res.rend());
  printf("%.10lf\n", res[k]);
  return 0;
}
