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 long double eps = 1e-15;
const long double pi = acos(-1.0);
inline bool lt(long double lhs, long double rhs) { return rhs - lhs >= eps; }
inline bool le(long double lhs, long double rhs) { return rhs - lhs > -eps; }
inline bool gt(long double lhs, long double rhs) { return lhs - rhs >= eps; }
inline bool ge(long double lhs, long double rhs) { return lhs - rhs > -eps; }
inline bool eq(long double lhs, long double rhs) {
  return fabs(rhs - lhs) < eps;
}
inline bool ne(long double lhs, long double rhs) {
  return fabs(rhs - lhs) >= eps;
}
inline bool zr(long double lhs) { return fabs(lhs) < eps; }
inline bool nz(long double lhs) { return fabs(lhs) >= eps; }
inline bool ps(long double lhs) { return lhs >= eps; }
inline bool nn(long double lhs) { return lhs > -eps; }
inline bool ng(long double lhs) { return lhs <= -eps; }
inline bool np(long double lhs) { return lhs < eps; }
struct Point {
  long double x, y;
  Point(long double x = 0, long double y = 0) : x(x), y(y) {}
  void get() { scanf("%Lf%Lf", &x, &y); }
  void put() const { printf("(%Lf, %Lf)", x, y); }
  double length() const { return sqrt(x * x + y * y); }
};
struct Segment {
  Point a, b;
  Segment() : a(), b() {}
  Segment(Point a, Point b) : a(a), b(b) {}
};
struct Line {
  long double A, B, C;
  Line() : A(0), B(0), C(0) {}
  Line(long double A, long double B, long double C) : A(A), B(B), C(C) {}
  Line(const Point& lhs, const Point& rhs)
      : A(rhs.y - lhs.y), B(lhs.x - rhs.x), C(-(lhs.x * A + lhs.y * B)) {}
  Line(long double slope, const Point& p)
      : A(slope), B(-1.0), C(p.y - slope * p.x) {}
  Line(const Point& p, long double slope)
      : A(slope), B(-1.0), C(p.y - slope * p.x) {}
  Line(const Segment& s) { *this = Line(s.a, s.b); }
  long double eval(const Point& p) const { return A * p.x + B * p.y + C; }
  void put() { printf("%Lf %Lf %Lf\n", A, B, C); }
};
const Point operator+(const Point& lhs, double rhs) {
  return Point(lhs.x + rhs, lhs.y + rhs);
}
const Point operator+(double lhs, const Point& rhs) {
  return Point(lhs + rhs.x, lhs + rhs.y);
}
const Point operator-(const Point& lhs, double rhs) {
  return Point(lhs.x - rhs, lhs.y - rhs);
}
const Point operator-(double lhs, const Point& rhs) {
  return Point(lhs - rhs.x, lhs - rhs.y);
}
const Point operator*(double lhs, const Point& rhs) {
  return Point(lhs * rhs.x, lhs * rhs.y);
}
const Point operator*(const Point& lhs, double rhs) {
  return Point(lhs.x * rhs, lhs.y * rhs);
}
const Point operator/(const Point& lhs, double rhs) {
  return Point(lhs.x / rhs, lhs.y / rhs);
}
Point& operator+=(Point& lhs, double rhs) {
  lhs.x += rhs;
  lhs.y += rhs;
  return lhs;
}
Point& operator-=(Point& lhs, double rhs) {
  lhs.x -= rhs;
  lhs.y -= rhs;
  return lhs;
}
Point& operator*=(Point& lhs, double rhs) {
  lhs.x *= rhs;
  lhs.y *= rhs;
  return lhs;
}
Point& operator/=(Point& lhs, double rhs) {
  lhs.x /= rhs;
  lhs.y /= rhs;
  return lhs;
}
const Point operator+(const Point& lhs, const Point& rhs) {
  return Point(lhs.x + rhs.x, lhs.y + rhs.y);
}
long double operator^(const Point& lhs, const Point& rhs) {
  return lhs.x * rhs.y - lhs.y * rhs.x;
}
long double operator*(const Point& lhs, const Point& rhs) {
  return lhs.x * rhs.x + lhs.y * rhs.y;
}
const Point operator-(const Point& lhs, const Point& rhs) {
  return Point(lhs.x - rhs.x, lhs.y - rhs.y);
}
const Point operator~(const Point& lhs) { return Point(-lhs.y, lhs.x); }
bool cross(const Segment& v, const Segment& w);
const Point intersect(const Line& a, const Line& b);
long double dist(const Point& a, const Point& b);
bool onSegment(const Point& p, const Segment& s);
const Point pedal(const Line&, const Point&);
const Point pedal(const Point&, const Line&);
const Point mirror(const Line&, const Point&);
const Point mirror(const Point&, const Line&);
const Line perpendicular(const Point&, const Line&);
const Line bisector(const Point&, const Point&);
void sortPolarCoor(vector<Point>& ps);
bool inTriangle(const Point& a, const Point& b, const Point& c, const Point& x);
bool inPolygon(vector<Point>& ps, Point p);
bool onSegment(const Point& p, const Segment& s) {
  return zr((p - s.a) ^ (p - s.b)) && np((p - s.a) * (p - s.b));
}
bool cross(const Segment& v, const Segment& w) {
  if (onSegment(v.a, w) || onSegment(v.b, w) || onSegment(w.a, v) ||
      onSegment(w.b, v))
    return true;
  return (ps((v.a - w.a) ^ (w.b - w.a)) ^ ps((v.b - w.a) ^ (w.b - w.a))) &&
         (ps((w.a - v.a) ^ (v.b - v.a)) ^ ps((w.b - v.a) ^ (v.b - v.a)));
}
const Point intersect(const Line& a, const Line& b) {
  return Point((a.B * b.C - b.B * a.C) / (b.B * a.A - a.B * b.A),
               (a.A * b.C - b.A * a.C) / (b.A * a.B - a.A * b.B));
}
Point x;
long double dist(const Point& a, const Point& b) {
  return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
}
bool Less(const Point& a, const Point& b) {
  Point hor(1, 0), va = a - x, vb = b - x;
  if ((va ^ vb) == 0 && va.x * vb.x > 0) {
    if (dist(va, x) < dist(vb, x))
      return 1;
    else
      return 0;
  }
  if ((va ^ hor) == 0) {
    if (va.x > 0 && !((vb ^ hor) == 0 && vb.x > 0)) return 1;
    if (va.x < 0 && (vb ^ hor) > 0) return 1;
    return 0;
  } else if ((va ^ hor) < 0) {
    if ((vb ^ hor) == 0 && vb.x < 0) return 1;
    if ((vb ^ hor) < 0 && (vb ^ va) < 0) return 1;
    if ((vb ^ hor) > 0) return 1;
    return 0;
  } else {
    if ((vb ^ va) < 0 && (vb ^ hor) > 0) return 1;
    return 0;
  }
}
void sortPolarCoor(vector<Point>& ps) { sort(ps.begin(), ps.end(), Less); }
bool inPolygon(vector<Point>& ps, Point p) {
  for (int i = 0; i <= (int)ps.size() - 1; i++) {
    int a = i, b = i == (int)ps.size() - 1 ? 0 : i + 1;
    Segment edge(ps[a], ps[b]);
    if (onSegment(p, edge)) return true;
  }
  long double leftm = DBL_MAX;
  for (int i = 0; i <= (int)ps.size() - 1; i++) {
    if (ps[i].x < leftm) leftm = ps[i].x;
  }
  Segment ray(Point(min(leftm, p.x) - 100, p.y), p);
  int count = 0;
  for (int i = 0; i <= (int)ps.size() - 1; i++) {
    int a = i, b = i == (int)ps.size() - 1 ? 0 : i + 1;
    bool upa, upb;
    if (eq(ps[a].y, p.y) || gt(ps[a].y, p.y))
      upa = 1;
    else
      upa = 0;
    if (eq(ps[b].y, p.y) || gt(ps[b].y, p.y))
      upb = 1;
    else
      upb = 0;
    if (upa ^ upb) {
      Segment edge(ps[a], ps[b]);
      Point inter = intersect(Line(edge), Line(ray));
      if (onSegment(inter, edge) && onSegment(inter, ray)) count++;
    }
  }
  return count % 2 == 1;
}
bool inTriangle(const Point& a, const Point& b, const Point& c,
                const Point& x) {
  if (onSegment(x, Segment(a, b)) || onSegment(x, Segment(b, c)) ||
      onSegment(x, Segment(c, a)))
    return 1;
  Point v1 = b - a, v2 = c - b, v3 = a - c;
  Point xa = x - a, xb = x - b, xc = x - c;
  int d1 = xa ^ v1, d2 = xb ^ v2, d3 = xc ^ v3;
  return d1 >> 31 == d2 >> 31 && d2 >> 31 == d3 >> 31;
}
const Point pedal(const Line& l, const Point& p) {
  long double k = l.eval(p) / (l.A * l.A + l.B * l.B);
  return Point(p.x - l.A * k, p.y - l.B * k);
}
const Point pedal(const Point& p, const Line& l) { return pedal(l, p); }
const Point mirror(const Line& l, const Point& p) {
  return pedal(l, p) * 2.0 - p;
}
const Point mirror(const Point& p, const Line& l) {
  return pedal(l, p) * 2.0 - p;
}
const Line perpendicular(const Point& p, const Line& l) {
  return Line(p, pedal(p, l));
}
const Line bisector(const Point& a, const Point& b) {
  return Line((a + b) / 2.0, (a + b) / 2.0 + ~(a - b));
}
long double spinRadius(Point a, Point b, bool f) {
  long double the = acos((a * b) / a.length() / b.length());
  if (eq(the, pi))
    return pi;
  else {
    if (f == 0) {
      if (ps(b ^ a))
        return the;
      else
        return 2 * pi - the;
    } else {
      if (ng(b ^ a))
        return the;
      else
        return 2 * pi - the;
    }
  }
}
struct pp {
  Point pos, in;
  long double w;
  bool flag;
  int type;
  long double rad;
  long double inir;
  Point dir;
};
const int MAX = 1e4 + 20;
pp pa[MAX];
Point A, B, ox;
int n, k;
void iniCal() {
  for (int i = 0; i < n; i++) {
    auto& ele = pa[i];
    ele.in = pedal(ele.pos, Line(A, B));
    bool f1 = onSegment(ele.in, Segment(A, B));
    if (f1)
      ele.type = 1;
    else if ((ele.in - A) * (B - A) > 0)
      ele.type = 3;
    else
      ele.type = 2;
    Point oa = A - ele.pos, ob = B - ele.pos;
    if ((oa ^ ob) > 0) {
      ele.flag = 1;
    } else {
      ele.flag = 0;
    }
    ele.rad = acos((oa * ob) / oa.length() / ob.length());
    ele.dir = {cos(ele.inir), sin(ele.inir)};
  }
}
struct data {
  Point pa, cur;
  long double the, w, v;
  bool f;
  long double cal(long double t) const {
    if (f)
      return cur.x - pa.x + v * t + pa.y / tan(the + w * t);
    else
      return cur.x - pa.x + v * t + pa.y / tan(the - w * t);
  }
};
pair<long double, long double> eval(const data& f, long double l,
                                    long double r) {
  while (abs(l - r) >= eps) {
    long double len = (r - l) / 3;
    long double p1 = l + len, p2 = l + 2 * len;
    if (le(f.cal(p1), f.cal(p2)))
      r = p2;
    else
      l = p1;
  }
  return {l, f.cal(l)};
}
int main() {
  scanf("%Lf%Lf%Lf%Lf", &A.x, &A.y, &B.x, &B.y);
  scanf("%d", &n);
  for (int i = 0; i < n; i++)
    scanf("%Lf%Lf%Lf%Lf", &pa[i].pos.x, &pa[i].pos.y, &pa[i].inir, &pa[i].w);
  scanf("%d", &k);
  iniCal();
  ox = {1, 0};
  long double l = 0, r = 2 * pi * pow(10, 10) + 20;
  pair<long double, long double> prev = {-1, -1};
  while (abs(r - l) >= eps && !(eq(prev.first, l) && eq(prev.second, r))) {
    long double mid = (l + r) / 2;
    long long ans = 0;
    for (int i = 0; i < n; i++) {
      long double rr;
      long long t1 = 0, t2 = 0;
      auto& ele = pa[i];
      if (zr(ele.w)) continue;
      Point ob = B - ele.pos;
      if (ele.flag == 0)
        rr = spinRadius(ele.dir, ob, 1);
      else
        rr = spinRadius(ele.dir, ob, 0);
      long double tt1, tt2;
      tt1 = rr / ele.w;
      if (le(tt1, mid)) t1 = 1;
      Point oa = A - ele.pos;
      if (ele.flag == 0)
        rr = spinRadius(ele.dir, oa, 0);
      else
        rr = spinRadius(ele.dir, oa, 1);
      tt1 = rr / ele.w;
      if (ge(tt1, mid))
        t2 = 0;
      else {
        if (ele.flag == 0)
          rr = spinRadius(oa, ob, 0);
        else
          rr = spinRadius(oa, ob, 1);
        tt2 = rr / ele.w;
        if (ele.type == 2) {
          if (le(tt1 + tt2, mid))
            t2 = 1;
          else
            t2 = 0;
        } else {
          long double a1, a2, v;
          Point ab = B - A;
          v = ab.length() / mid;
          if (le(tt1 + tt2, mid))
            t2 = 1;
          else {
            Point oin = ele.in - ele.pos;
            if (ele.type == 1) {
              if (ele.flag == 0)
                rr = spinRadius(oa, oin, 0);
              else
                rr = spinRadius(oa, oin, 1);
              tt2 = rr / ele.w;
              a1 = tt1, a2 = tt1 + tt2;
            } else {
              if (ele.flag == 0)
                rr = spinRadius(oa, ob, 0);
              else
                rr = spinRadius(oa, ob, 1);
              tt2 = rr / ele.w;
              a1 = tt1, a2 = tt1 + tt2;
            }
            if (eq(a1, a2))
              t2 = 0;
            else {
              Point cur = ab * a1 / mid + A;
              a2 = a2 - a1, a1 = 0;
              long double the = acos(ab * oa / ab.length() / oa.length());
              bool ss;
              if (ps(oa ^ ab))
                the = pi - the, ss = 1;
              else
                ss = 0;
              data f;
              f.cur = cur - ele.in, f.pa = ele.pos - ele.in, f.the = the,
              f.v = v, f.w = ele.w, f.f = ss;
              pair<int, int> hh = eval(f, a1, a2);
              if (np(hh.second))
                t2 = 1;
              else
                t2 = 0;
            }
          }
        }
      }
      ans += std::max(t1, t2);
    }
    prev = {l, r};
    if (ans > k)
      r = mid;
    else
      l = mid;
  }
  printf("%.9Lf\n", sqrt(dist(A, B)) / l);
  return 0;
}
