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;
int n, m, k;
bool debug = false;
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 arg = (B - p).arg();
    if (arg < -1e-6) arg += 2 * 3.1415926535897;
    double jo = max(arg, a) - min(arg, a);
    jo = min(jo, 2 * 3.1415926535897 - jo);
    js[jo / w]++;
  }
  scanf("%d", &k);
  int sk = 0;
  double t = -10;
  for (map<double, int>::iterator it = js.begin(); it != js.end(); it++) {
    if (sk + it->second > k) {
      t = it->first;
      break;
    }
    sk += it->second;
  }
  printf("%.4lf\n", t < -1 ? 0 : (B - A).abs() / t);
  return 0;
}
