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 double pi = acos(-1.00), eps = 1e-9;
struct point {
  double x, y, w, a;
};
point st, en, tank[11111];
int n, k;
void norm(double &theta) {
  while (theta < -pi + eps) theta += 2 * pi;
  while (theta > pi + eps) theta -= 2 * pi;
}
bool check(double v) {
  int i, j, s, p, q, nk = 0, it;
  double now_t, theta, dist, T, w;
  double ltheta, low, high, mid, mt, vs, fs, bs, mx, my, fx, fy;
  bool ft;
  dist = sqrt((en.x - st.x) * (en.x - st.x) + (en.y - st.y) * (en.y - st.y));
  T = dist / v;
  for (i = 0; i < n; i++) {
    theta = atan2(en.y - tank[i].y, en.x - tank[i].x);
    while (theta < tank[i].a - eps) theta += 2 * pi;
    theta -= tank[i].a;
    if (theta > pi) theta = 2 * pi - theta;
    now_t = theta / tank[i].w;
    if (v * now_t <
        sqrt((en.x - st.x) * (en.x - st.x) + (en.y - st.y) * (en.y - st.y))) {
      nk++;
      continue;
    }
    ltheta = atan2(st.y - tank[i].y, st.x - tank[i].x);
    theta = ltheta;
    while (theta < tank[i].a - eps) theta += 2 * pi;
    theta -= tank[i].a;
    if (theta > pi) theta = 2 * pi - theta;
    now_t = theta / tank[i].w;
    if (v * now_t >
        sqrt((en.x - st.x) * (en.x - st.x) + (en.y - st.y) * (en.y - st.y)))
      continue;
    if (tank[i].w == 0)
      continue;
    else {
      while (ltheta < tank[i].a - eps) ltheta += 2 * pi;
      ltheta -= tank[i].a;
      w = tank[i].w;
      if (ltheta > pi) {
        w = -w;
        ltheta = 2 * pi - ltheta;
      }
      theta = atan2(en.y - st.y, en.x - st.x);
      low = ltheta / tank[i].w;
      high = T;
      if (low > high) continue;
      mt = low;
      fs = (st.x + v * cos(theta) * mt - tank[i].x) * sin(tank[i].a + w * mt) -
           (st.y + v * sin(theta) * mt - tank[i].y) * cos(tank[i].a + w * mt);
      mt = high;
      bs = (st.x + v * cos(theta) * mt - tank[i].x) * sin(tank[i].a + w * mt) -
           (st.y + v * sin(theta) * mt - tank[i].y) * cos(tank[i].a + w * mt);
      if ((fs < eps && bs > -eps) || (fs > -eps && bs < eps)) {
        nk++;
        continue;
      }
      for (it = 0; it < 100; it++) {
        mx = mt = (2 * low + high) / 3.;
        fx =
            (st.x + v * cos(theta) * mt - tank[i].x) * sin(tank[i].a + w * mt) -
            (st.y + v * sin(theta) * mt - tank[i].y) * cos(tank[i].a + w * mt);
        my = mt = (low + 2 * high) / 3.;
        fy =
            (st.x + v * cos(theta) * mt - tank[i].x) * sin(tank[i].a + w * mt) -
            (st.y + v * sin(theta) * mt - tank[i].y) * cos(tank[i].a + w * mt);
        if ((fs > 0 && fx > fy) || (fs < 0 && fx < fy))
          low = mx;
        else
          high = my;
      }
      mt = 0.5 * (low + high);
      fx = (st.x + v * cos(theta) * mt - tank[i].x) * sin(tank[i].a + w * mt) -
           (st.y + v * sin(theta) * mt - tank[i].y) * cos(tank[i].a + w * mt);
      if ((fs > 0 && fx < eps) || (fs < 0 && fx > -eps)) {
        nk++;
        continue;
      }
    }
  }
  return nk <= k;
}
int main() {
  int i, j, s, p, q;
  double low, high, mid;
  scanf("%lf%lf%lf%lf", &st.x, &st.y, &en.x, &en.y);
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%lf%lf%lf%lf", &tank[i].x, &tank[i].y, &tank[i].a, &tank[i].w);
    norm(tank[i].a);
  }
  scanf("%d", &k);
  low = 0;
  high = 1e9;
  while (low < high - eps) {
    mid = (low + high) * 0.5;
    if (check(mid))
      high = mid;
    else
      low = mid + eps;
  }
  printf("%.20f\n", (low + high) * 0.5);
  return 0;
}