#include <bits/stdc++.h>
using namespace std;
int n, m, k;
struct Point {
  double x, y;
  Point() {}
  Point(double x, double y) : x(x), y(y) {}
  double abs() const { return hypot(x, y); }
  double arg() const { return atan2(y, x); }
  Point operator*(double o) const { return Point(x * o, y * o); }
  Point operator+(const Point& o) const { return Point(x + o.x, y + o.y); }
  Point operator-(const Point& o) const { return Point(x - o.x, y - o.y); }
  bool operator<(const Point& o) const {
    return x < o.x - 1e-6 || (x < o.x + 1e-6 && y < o.y - 1e-6);
  }
};
Point A, B;
map<double, int> js;
int main() {
  scanf("%lf%lf%lf%lf", &A.x, &A.y, &B.x, &B.y);
  scanf("%d", &n);
  double x, y, a, w;
  for (int i = 0; i < n; i++) {
    scanf("%lf%lf%lf%lf", &x, &y, &a, &w);
    if (abs(w) < 1e-6) continue;
    Point p = {x, y};
    double v = -2;
    for (int j = 0; j <= 100; j++) {
      Point tp = (B - A) * (j / 100.0) + A;
      double arg = (tp - p).arg() - a;
      if (arg > 2 * acos(-1)) arg -= 2 * acos(-1);
      while (arg < 0) arg += 2 * acos(-1);
      if (arg > 2 * acos(-1) - arg) arg = 2 * acos(-1) - arg;
      double t = arg / w;
      v = v < -1 ? (tp - A).abs() / t : max(v, (tp - A).abs() / t);
    }
    js[v]++;
  }
  scanf("%d", &k);
  int sk = 0;
  double t = -10;
  for (map<double, int>::reverse_iterator it = js.rbegin(); it != js.rend();
       it++) {
    if (sk + it->second > k) {
      t = it->first;
      break;
    }
    sk += it->second;
  }
  printf("%.4lf\n", t < -1 ? 0 : t);
  return 0;
}
