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;
template <class T>
inline void read(T& x) {
  bool fu = 0;
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  if (c == '-') fu = 1, c = getchar();
  for (x = 0; c > 32; c = getchar()) x = x * 10 + c - '0';
  if (fu) x = -x;
};
template <class T>
inline void read(T& x, T& y) {
  read(x);
  read(y);
}
template <class T>
inline void read(T& x, T& y, T& z) {
  read(x);
  read(y);
  read(z);
}
inline char getc() {
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  return c;
}
const double pi = 2 * acos(0);
struct node {
  double x, y;
};
void read(node& a) { read(a.x, a.y); }
int sgn(double x) {
  if (x == 0) return 0;
  return x > 0 ? 1 : -1;
}
node operator+(node a, node b) { return (node){a.x + b.x, a.y + b.y}; }
node operator-(node a, node b) { return (node){a.x - b.x, a.y - b.y}; }
node operator*(node a, double x) { return (node){a.x * x, a.y * x}; }
node operator/(node a, double x) { return (node){a.x / x, a.y / x}; }
node mul(node a, node b) { return (node){a.x * b.x, a.y * b.y}; }
double operator*(node a, node b) { return a.x * b.y - a.y * b.x; }
double xj(node a, node b, node c) { return (b - a) * (c - a); }
double len(node a) { return sqrt(a.x * a.x + a.y * a.y); }
bool on(node a, node b, node c) {
  if (a.x >= min(b.x, c.x) && a.x <= max(b.x, c.x) && a.y >= min(b.y, c.y) &&
      a.y <= max(b.y, c.y) && xj(b, a, c) == 0)
    return 1;
  return 0;
}
bool pdj(node a, node b, node c, node d) {
  return sgn(xj(a, c, b)) * sgn(xj(a, b, d)) > 0 &&
         sgn(xj(b, c, a)) * sgn(xj(b, a, d)) > 0 &&
         sgn(xj(c, b, d)) * sgn(xj(c, d, a)) > 0 &&
         sgn(xj(d, a, c)) * sgn(xj(d, c, b)) > 0;
}
int n, i, j, k, p, K;
double L, R;
node A, B, C, D;
double alp, w, a[11111];
const int W = 2000;
int main() {
  read(A);
  read(B);
  read(n);
  for (i = 1; i <= n; i++) {
    read(C);
    scanf("%lf%lf", &alp, &w);
    double vmax = 0, z;
    for (int cnt = (0); cnt <= (W); cnt++) {
      D = (node){(A.x + (B.x - A.x) / W * cnt), (A.y + (B.y - A.y) / W * cnt)};
      z = alp - atan2(D.y - C.y, D.x - C.x);
      while (z < 0) z += 2 * pi;
      while (z >= 2 * pi) z -= 2 * pi;
      if (z > pi) z = 2 * pi - z;
      vmax = max(vmax, len(D - A) / (z / w + 1e-12));
    }
    a[i] = vmax;
  }
  read(K);
  sort(a + 1, a + 1 + n);
  cout << fixed << setprecision(10) << a[K + 1] << endl;
  return 0;
}
