Problem: Vasya plays the Plane of Tanks. The tanks in this game keep trying to finish each other off. But your "Pedalny" is not like that... He just needs to drive in a straight line from point A to point B on the plane. Unfortunately, on the same plane are n enemy tanks. We shall regard all the tanks as points. At the initial moment of time Pedalny is at the point A. Enemy tanks would be happy to destroy it immediately, but initially their turrets are tuned in other directions. Specifically, for each tank we know the initial rotation of the turret ai (the angle in radians relative to the OX axis in the counterclockwise direction) and the maximum speed of rotation of the turret wi (radians per second). If at any point of time a tank turret will be aimed precisely at the tank Pedalny, then the enemy fires and it never misses. Pedalny can endure no more than k shots. Gun reloading takes very much time, so we can assume that every enemy will produce no more than one shot. Your task is to determine what minimum speed of v Pedalny must have to get to the point B. It is believed that Pedalny is able to instantly develop the speed of v, and the first k shots at him do not reduce the speed and do not change the coordinates of the tank.

Input

The first line contains 4 numbers – the coordinates of points A and B (in meters), the points do not coincide. On the second line number n is given (1 ≤ n ≤ 104). It is the number of enemy tanks. Each of the following n lines contain the coordinates of a corresponding tank xi, yi and its parameters ai and wi (0 ≤ ai ≤ 2π, 0 ≤ wi ≤ 100). Numbers ai and wi contain at most 5 digits after the decimal point. All coordinates are integers and their absolute values do not exceed 105. Enemy tanks can rotate a turret in the clockwise as well as in the counterclockwise direction at the angular speed of not more than wi. It is guaranteed that each of the enemy tanks will need at least 0.1 seconds to aim at any point of the segment AB and each of the enemy tanks is posistioned no closer than 0.1 meters to line AB. On the last line is given the number k (0 ≤ k ≤ n).

Output

Print a single number with absolute or relative error no more than 10 - 4 — the minimum required speed of Pedalny in meters per second.

Examples

Input

0 0 10 0
1
5 -5 4.71238 1
0


Output

4.2441


Input

0 0 10 0
1
5 -5 4.71238 1
1


Output

0.0000

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 10000;
int n;
double x1, y3223789, x2, y2;
double x[MAXN], y[MAXN], w[MAXN], a0[MAXN];
double t1[MAXN], t2[MAXN], d[MAXN], p[MAXN];
double pi = 2 * acos(0.0);
double cross(double x1, double y3223789, double x2, double y2) {
  return x1 * y2 - x2 * y3223789;
}
double getmin(double x) {
  while (x < 0) x += 2 * pi;
  while (x > 2 * pi) x -= 2 * pi;
  return min(x, 2 * pi - x);
}
double get_time(int i, double xx, double yy) {
  double ang = atan2(yy - y[i], xx - x[i]) - a0[i];
  return getmin(ang) / w[i];
}
double inter(double x1, double y3223789, double x2, double y2, double x3,
             double y3, double x4, double y4) {
  double d = cross(x2 - x1, y2 - y3223789, x3 - x4, y3 - y4);
  double p = cross(x2 - x1, y2 - y3223789, x3 - x1, y3 - y3223789);
  return p / d;
}
double nt;
int check(int i, double v) {
  if (get_time(i, x2, y2) < nt) return 1;
  if (p[i] < 0) return 0;
  double l = 0, r = min(1.0, p[i]);
  for (int o = 0; o < 50; o++) {
    double c1 = (l * 2 + r) / 3;
    double c2 = (l + 2 * r) / 3;
    double cx1 = x1 * (1 - c1) + x2 * c1;
    double cy1 = y3223789 * (1 - c1) + y2 * c1;
    double cx2 = x1 * (1 - c2) + x2 * c2;
    double cy2 = y3223789 * (1 - c2) + y2 * c2;
    double t1 = get_time(i, cx1, cy1);
    double t2 = get_time(i, cx2, cy2);
    t1 -= nt * c1;
    t2 -= nt * c2;
    if (t1 < 0 || t2 < 0) return 1;
    if (t1 < t2)
      r = c2;
    else
      l = c1;
  }
  return 0;
}
int getans(double v) {
  int ans = 0;
  nt = sqrt((x2 - x1) * (x2 - x1) + (y2 - y3223789) * (y2 - y3223789)) / v;
  for (int i = 0; i < n; i++)
    if (check(i, v)) ans++;
  return ans;
}
int main() {
  cin >> x1 >> y3223789 >> x2 >> y2;
  double dist = sqrt((x2 - x1) * (x2 - x1) + (y2 - y3223789) * (y2 - y3223789));
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i] >> a0[i] >> w[i];
    double tmp = cross(x[i] - x1, y[i] - y3223789, x[i] - x2, y[i] - y2);
    t1[i] = get_time(i, x1, y3223789);
    t2[i] = get_time(i, x2, y2);
    p[i] = inter(x[i], y[i], x[i] + y2 - y3223789, y[i] + x1 - x2, x1, y3223789,
                 x2, y2);
    d[i] = abs(tmp) / dist;
  }
  int k;
  cin >> k;
  double l = 0, r = 4000000;
  while (r - l > 1e-5) {
    double v = (l + r) / 2;
    if (getans(v) > k)
      l = v;
    else
      r = v;
  }
  printf("%.4lf", (l + r) / 2);
  return 0;
}