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.

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).

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

#pragma comment(linker, "/STACK:60777216")

#include <algorithm>
#include <iostream>
#include <complex>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <ctime>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

#define sz(a)                   int(a.size())
#define all(a)                  (a).begin(), (a).end()
#define CL(a, b)                memset(a, b, sizeof a)
#define FOR(i, a, b)			for (int i(a); i < (b); ++i)
#define REP(i, n)               FOR(i, 0, n)
#define UN(a)                   sort(all(a)), (a).erase(unique(all(a)), (a).end())
#define pb                      push_back
#define SORT(a)                 sort(all(a))

typedef long long ll;
typedef vector <int> vi;
typedef pair <int, int> pii;

double xa,ya,xb,yb;
int n;
double x[11111],y[11111],a[11111],w[11111];
int k;

const double pi = acos(-1.);

double go(double a,double w){
	double v = 0;
	int num = 100;
	REP(i,num+1){

		double x = xa + (xb-xa)*i/double(num);
		double y = ya + (yb-ya)*i/double(num);
		double q = atan2(y,x) - a;

		if(q>2*pi) q-=2*pi;
		while(q<0) q+=2*pi;
		if(q>2*pi-q) q = 2*pi - q;

		double T = (w < 1e-5 ? (i==0 ? 0 : 1e10) : q/w);

		v = max(v,hypot(x-xa,y-ya)/T);
	}

	return v;
}

int main() {
#ifdef LocalHost
	freopen("input.txt", "r", stdin);
#endif

	cin>>xa>>ya>>xb>>yb>>n;
	REP(i,n) scanf("%lf %lf %lf %lf",x+i,y+i,a+i,w+i);
	cin>>k;

	vector<double> v;
	REP(i,n){
		xa-=x[i],ya-=y[i],xb-=x[i],yb-=y[i];
		v.pb(go(a[i],w[i]));
		xa+=x[i],ya+=y[i],xb+=x[i],yb+=y[i];
	}
	SORT(v);
	reverse(v.begin(),v.end());
	if(k>=v.size()) puts("0.0000");
	else printf("%.4lf\n",v[k]);
	return 0;
}

#include<stdio.h>
#include<math.h>
#include<vector>
#include<algorithm>
using namespace std;
const double pi=acos(-1.0);
double ax,ay,bx,by;
double dis(double x,double y)
{
    return sqrt(x*x+y*y);
}
double get(double a,double w)
{
    double v=0;
    int num=100;
    for(int i=0;i<=100;i++)
    {
        double x=ax+(bx-ax)*i/(double)num;
        double y=ay+(by-ay)*i/(double)num;
        double p=atan2(y,x)-a;
        if(p>2*pi) p-=2*pi;
        while(p<0) p+=2*pi;
        if(p>2*pi-p) p=2*pi-p;
        double t=((w<1e-5)?(i==0?0:1e10):p/w);
        v=max(v,hypot(x-ax,y-ay)/t);
        //printf("%.5lf\n",t);
    }
    return v;
}
double x[10010],y[10010],a[10010],w[10010];
int main()
{
    int n,k;
    while(scanf("%lf%lf%lf%lf",&ax,&ay,&bx,&by)!=EOF)
    {
        scanf("%d",&n);
        for(int i=0;i<n;i++)
            scanf("%lf%lf%lf%lf",&x[i],&y[i],&a[i],&w[i]);
        vector<double>v;
        v.clear();
        for(int i=0;i<n;i++)
        {
            ax-=x[i];ay-=y[i];bx-=x[i];by-=y[i];
            double vv=get(a[i],w[i]);
            //printf("%.5lf\n",vv);
            v.push_back(vv);
            ax+=x[i];ay+=y[i];bx+=x[i];by+=y[i];
        }
        sort(v.begin(),v.end());
        reverse(v.begin(),v.end());
        scanf("%d",&k);
        if(k>=v.size()) printf("0.00000\n");
        else printf("%.5lf\n",v[k]);
    }
    return 0;
}

#include <cstdio>
#include <numeric>
#include <iostream>
#include <vector>
#include <set>
#include <cstring>
#include <string>
#include <map>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <queue>
#include <sstream>
#include <deque>

using namespace std;

#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i = 0; i < (n); i++)
#define re return
#define fi first
#define se second
#define sz(x) ((int) (x).size())
#define all(x) (x).begin(), (x).end()
#define sqr(x) ((x) * (x))
#define sqrt(x) sqrt(abs(x))
#define y0 y3487465
#define y1 y8687969
#define fill(x,y) memset(x,y,sizeof(x))

typedef vector<int> vi;
typedef long long ll;
typedef long double ld;
typedef double D;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
typedef vector<vi> vvi;

template<class T> T abs(T x) { re x > 0 ? x : -x; }

const double pi = 2 * asin (1.0);

int n;
int m;
double x[10000], y[10000], a[10000], w[10000];
double ax, ay, bx, by;

double dist (double x1, double y1, double x2, double y2) {
    re sqrt (sqr (x2 - x1) + sqr (y2 - y1));
}

double get (int i, double x, double y) {
    double b = atan2 (y - ::y[i], x - ::x[i]);
    double ang = abs (a[i] - b);
    if (ang > 2 * pi) ang -= 2 * pi;
    re min (ang, 2 * pi - ang) / w[i];
}

double cross (double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) {
    double a = x2 - x1;
    double b = x3 - x4;
    double c = x3 - x1;
    double d = y2 - y1;
    double e = y3 - y4;
    double f = y3 - y1;
    re (c * e - b * f) / (a * e - b * d);
}

int calc (double v) {
    int tmp = 0;
    double d = dist (ax, ay, bx, by);
    double dx = (bx - ax);
    double dy = (by - ay);
    double t = d / v;
    for (int i = 0; i < n; i++) {
        if (w[i] < 1e-6) continue;
        if (get (i, bx, by) < t) tmp++; else {
            double l = 0, r = max (0.0, min (1.0, cross (ax, ay, bx, by, x[i], y[i], x[i] + (by - ay), y[i] + (ax - bx))));
            for (int it = 0; it < 40; it++) {
                double s1 = (2 * l + r) / 3;
                double s2 = (l + 2 * r) / 3;
                double d1 = get (i, ax + dx * s1, ay + dy * s1) - t * s1;
                double d2 = get (i, ax + dx * s2, ay + dy * s2) - t * s2;
                if (d1 < d2) r = s2; else l = s1;
            }
            double ss = (l + r) / 2;
            double dd = get (i, ax + dx * ss, ay + dy * ss) - t * ss;
            if (dd < 0) tmp++;
        }
        }
    re tmp;
}

int main () {
    cin >> ax >> ay >> bx >> by >> n;
    for (int i = 0; i < n; i++)
        cin >> x[i] >> y[i] >> a[i] >> w[i];
    cin >> m;
    double l = 0, r = 1e10;
    for (int it = 0; it < 60; it++) {
        double s = (l + r) / 2;
        if (calc (s) <= m) r = s; else l = s;
    }
    printf ("%.10f\n", r);
    return 0;
}

#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;
#define x first
#define y second
typedef double dbl;

typedef pair <dbl, dbl> pnt;

pnt operator - (pnt a, pnt b) {
  return pnt (a.x - b.x, a.y - b.y);
}

pnt st, dir;
dbl _w, _s, _len;

inline dbl f(dbl t) {
  dbl x = st.x + dir.x * t,
      y = st.y + dir.y * t;
  dbl r = atan2 (y, x) - _s;
  while (r < 0) {
    r += 2 * M_PI;
  }
  while (r > 2 * M_PI) {
    r -= 2 * M_PI;
  }
//  fprintf (stderr,  "%lf : %lf (%lf %lf) | %lf\n", _len * t * _w, min(r, 2 * M_PI - r), x, y, r);
  return _len * t * _w / min(r, 2 * M_PI - r);
}

dbl get (pnt a, pnt b, dbl s, dbl w) {
  st = a;
  dir = b - a;
  _s = s;
  _w = w;
  _len = hypot (dir.x, dir.y);

  dbl res = 0;
  for (int i = 0; i <= 100; i++) {
    dbl t = f (i / 100.);
    if (t > res) {
      res = t;
    }
  }
  return res;
}

void read (pnt &p) {
  double x, y;
  scanf ("%lf%lf", &x, &y);
  p.x = x;
  p.y = y;
}

int main (void) {
  pnt a, b;
  read(a);
  read(b);

  int n;
  scanf ("%d", &n);

  vector <dbl> v(1, 0);
  for (int i = 0; i < n; i++) {
    pnt p;
    read(p);
    double s, w;
    scanf("%lf%lf", &s, &w);
    v.push_back(get(a - p, b - p, s, w));
  }

  sort (v.begin(), v.end());
  reverse (v.begin(), v.end());
  int k;
  scanf ("%d", &k);
  printf ("%.20lf\n", v[k]);

  return 0;
}

#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;
#define x first
#define y second
typedef double dbl;

typedef pair <dbl, dbl> pnt;

pnt operator - (pnt a, pnt b) {
  return pnt (a.x - b.x, a.y - b.y);
}

pnt st, dir;
dbl _w, _s, _len;

inline dbl f(dbl t) {
  dbl x = st.x + dir.x * t,
      y = st.y + dir.y * t;
  dbl r = atan2 (y, x) - _s;
  while (r < 0) {
    r += 2 * M_PI;
  }
  while (r > 2 * M_PI) {
    r -= 2 * M_PI;
  }
//  fprintf (stderr,  "%lf : %lf (%lf %lf) | %lf\n", _len * t * _w, min(r, 2 * M_PI - r), x, y, r);
  return _len * t * _w / min(r, 2 * M_PI - r);
}

dbl get (pnt a, pnt b, dbl s, dbl w) {
  st = a;
  dir = b - a;
  _s = s;
  _w = w;
  _len = hypot (dir.x, dir.y);

  dbl res = 0;
  for (int i = 0; i <= 200; i++) {
    dbl t = f (i / 200.);
    if (t > res) {
      res = t;
    }
  }
  return res;
}

void read (pnt &p) {
  double x, y;
  scanf ("%lf%lf", &x, &y);
  p.x = x;
  p.y = y;
}

int main (void) {
  pnt a, b;
  read(a);
  read(b);

  int n;
  scanf ("%d", &n);

  vector <dbl> v(1, 0);
  for (int i = 0; i < n; i++) {
    pnt p;
    read(p);
    double s, w;
    scanf("%lf%lf", &s, &w);
    v.push_back(get(a - p, b - p, s, w));
  }

  sort (v.begin(), v.end());
  reverse (v.begin(), v.end());
  int k;
  scanf ("%d", &k);
  printf ("%.20lf\n", v[k]);

  return 0;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

#define clr(x) memset((x), 0, sizeof(x))
#define pb push_back
#define mp make_pair
#define sz size()
#define For(i, st, en) for(int i=(st); i<=(int)(en); i++)
#define Ford(i, st, en) for(int i=(st); i>=(int)(en); i--)
#define forn(i, n) for(int i=0; i<(int)(n); i++)
#define ford(i, n) for(int i=(n)-1; i>=0; i--)
#define fori(it, x) for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)

template <class _T> inline _T sqr(const _T& x) { return x * x; }
template <class _T> inline string tostr(const _T& a) { ostringstream os(""); os << a; return os.str(); }

typedef double ld;

// Constants
const ld PI = 3.1415926535897932384626433832795;
const ld EPS = 1e-11;

// Types
typedef long long i64;
typedef set < int > SI;
typedef vector < int > VI;
typedef map < string, int > MSI;
typedef pair < int, int > PII;

struct tp{ld x,y;};

int n, k;
tp a[10240];
ld ang[10240];
ld w[10240];
tp p1, p2;
ld b0[10240];
ld tt;

inline ld dist(tp p1, tp p2)
{
	return sqrt(sqr(p1.x-p2.x) + sqr(p1.y-p2.y));
}

inline bool hit(ld s, int i)
{
	if (w[i] < EPS) return false;
	ld da = fabs(ang[i] - b0[i]);
	da = min(da, 2.0 * PI - da);
	ld t = da / w[i];
	if (t <= tt) return true;

	int z = 2;
	forn(j, z)
	{
		ld mi = j * 1.0 / z;
		ld ma = (j + 1.0) / z;
		forn(tt, 101)
		{
			if (ma - mi < 1e-11) break;
			ld q1 = (mi * 2.0 + ma) / 3.0;
			ld q2 = (mi + 2.0 * ma) / 3.0;

			tp pp1, pp2;
			pp1.x = p1.x + (p2.x - p1.x) * q1;
			pp1.y = p1.y + (p2.y - p1.y) * q1;
			pp2.x = p1.x + (p2.x - p1.x) * q2;
			pp2.y = p1.y + (p2.y - p1.y) * q2;
			ld aa1 = atan2(pp1.y - a[i].y, pp1.x - a[i].x);
			ld aa2 = atan2(pp2.y - a[i].y, pp2.x - a[i].x);
			ld a1 = fabs(ang[i] - aa1);
			a1 = min(a1, 2.0 * PI - a1);
			ld a2 = fabs(ang[i] - aa2);
			a2 = min(a2, 2.0 * PI - a2);
			ld t1 = a1 / w[i];
			ld t2 = a2 / w[i];
			ld d1 = dist(p1, pp1);
			ld d2 = dist(p1, pp2);
			t1 -= d1 / s;
			t2 -= d2 / s;
			if (t1 <= 0.0) return true;
			if (t2 <= 0.0) return true;
			if (t1 < t2) ma = q2;
			else mi = q1;
		}
	}
	return false;
}

bool check(ld s)
{
	int cnt = 0;
	tt = dist(p1, p2) / s;
	forn(i, n)
	{
		if (cnt + n - i <= k) return true;
		cnt += hit(s, i);
		if (cnt > k) return false;
	}
	return cnt <= k;
}

int main()
{
#ifdef ROOM_311
	time_t et_0 = clock();
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif
	cout << setiosflags(ios::fixed) << setprecision(10);

	int x, y;
	scanf("%d%d", &x, &y);
	p1.x = x;
	p1.y = y;
	scanf("%d%d", &x, &y);
	p2.x = x;
	p2.y = y;
	scanf("%d", &n);
	forn(i, n)
	{
		scanf("%d%d", &x, &y);
		a[i].x = x;
		a[i].y = y;
		double aa, ww;
		scanf("%lf%lf", &aa, &ww);
		if (aa > PI)
		{
			aa -= 2.0 * PI;
		}
		ang[i] = aa;
		w[i] = ww;
	}
	scanf("%d", &k);
	forn(i, n)
	{
		b0[i] = atan2(p2.y - a[i].y, p2.x - a[i].x);
	}

	ld mi = 3e-5;
	ld ma = 4e+6;

	while (ma - mi > 3e-5 && (ma - mi) / (ma + mi) > 3e-5)
	{
		ld q = (mi + ma) * 0.5;
		*(check(q) ? &ma : &mi) = q;
	}
	printf("%0.5lf\n", (double)mi);

#ifdef ROOM_311
	time_t et_1 = clock();
	fprintf(stderr, "Execution time = %0.0lf ms\n", (et_1 - et_0) * 1000.0 / CLOCKS_PER_SEC);
#endif
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define M 100010
#define ep 1e-7

const double pi = acos(-1);

struct pnt {
	double x, y;
	pnt (double x = 0, double y = 0) : x(x), y(y) {}
	pnt operator +(pnt a) {return pnt(x + a.x, y + a.y);}
	pnt operator -(pnt a) {return pnt(x - a.x, y - a.y);}
	pnt operator /(double a) {return pnt(x / a, y / a);}
	pnt operator *(double a) {return pnt(x * a, y * a);}
	double operator ^ (pnt a) {return x * a.y - y * a.x;}
	double operator & (pnt a) {return x * a.x + y * a.y;}
	double dist() {return sqrt(x * x + y * y);}
	void input() {scanf("%lf %lf", &x, &y);}
	void print() {printf("%lf %lf\n", x, y);}
} pos[M], A, B;

double vec[M], a[M], w[M];
int n;

double angle(pnt b, pnt a, pnt c) {
	return acos((b - a & c - a) / (c - a).dist() / (b - a).dist());
}

double D;
int P;

double f(double x, int i, double d, double t, double dl, double v, double al) {
	return dl + v * x - d * sin(w[i] * x) / sin(al + w[i] * x);
}

bool check(double v) {
	int tot = 0;
	for (int i = 0; i < n; i++) {
		if (tot > P) return 0;
		pnt tp = pnt(cos(a[i]), sin(a[i]));
		double t = angle(pos[i] + tp, pos[i], B) / w[i];
		if (v * t < D) {tot++; continue;}
		t = angle(pos[i] + tp, pos[i], A) / w[i];
		if (v * t > D - ep) continue;
		double al = angle(pos[i], A, B);
		if (al > pi / 2 - ep) continue;
    double d = (pos[i] - A).dist();
    double T = (D - v * t) / v, dl = v * t;
    double st = 0, en = T;
    while (st < en - ep) {
			double x = (2 * st + en) / 3, y = (st + 2 * en) / 3;
			if (f(x, i, d, t, dl, v, al) < f(y, i, d, t, dl, v, al)) en = y;
			else st = x;
    }
    if (f(st, i, d, t, dl, v, al) < ep) tot++;
	}
	if (tot > P) return 0;
	return 1;
}

int main() {
	//freopen("F.in", "r", stdin);
	A.input(), B.input();
	D = (A - B).dist();
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		pos[i].input(); cin >> a[i] >> w[i];
	}
	scanf("%d", &P);
	double l = 0, r = 1e9;
	while (l < r - ep) {
		double mid = (l + r) / 2;
		if (check(mid)) r = mid;
		else l = mid;
	}
	printf("%.12lf\n", l);
}

#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>

using namespace std;

#define REP(i,n) for((i)=0;(i)<(int)(n);(i)++)
#define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)

#define PI acos(-1.0)

struct point {double x,y;};

double dist(point &P, point &Q){
    double dx = P.x - Q.x, dy = P.y - Q.y;
    return sqrt(dx*dx + dy*dy);
}

double inprod(point &O, point &P, point &Q){
    return (P.x - O.x) * (Q.x - O.x) + (P.y - O.y) * (Q.y - O.y);
}

point foot(point &P, point &A, point &B){
    double t = inprod(A,B,P) / inprod(A,B,B);
    point ans = {A.x + (B.x - A.x) * t, A.y + (B.y - A.y) * t};
    return ans;
}

point rotate(point &P, double theta){
    double x = P.x * cos(theta) - P.y * sin(theta);
    double y = P.x * sin(theta) + P.y * cos(theta);
    point ans = {x,y};
    return ans;
}

double arg(point &P){
    double ans = atan2(P.y,P.x);
    if(ans < 0.0) ans += 2.0 * PI;
    return ans;
}

bool check(point &A, point &C, double v, double w){
    double t = dist(A,C) / v;
    double theta = arg(C); theta = min(theta, 2.0 * PI - theta);
    return (w * t > theta);
}

double func(point A, point B, point P, double a, double w){
    int iter;

    if(w < 1.0E-6) return 0.0;

    A.x -= P.x; A.y -= P.y; B.x -= P.x; B.y -= P.y;
    A = rotate(A,-a); B = rotate(B,-a);

    if(arg(A) > arg(B)) {A.y = -A.y; B.y = -B.y;}

    point O = {0.0,0.0};

    double low = 0.0, high = 1.0E+7, mid;
    REP(iter,100){
        mid = (high + low) / 2.0;

        if(check(A,B,mid,w)) {low = mid; continue;}

        point H = foot(O,A,B);
        double h = dist(O,H);

        if(h*w < mid){
            double t = sqrt(mid / (h*w) - 1.0);

            point C = {H.x + H.y * t, H.y - H.x * t};
            if(inprod(C,A,B) < 0.0 && check(A,C,mid,w)) {low = mid; continue;}

            point D = {H.x - H.y * t, H.y + H.x * t};
            if(inprod(D,A,B) < 0.0 && check(A,D,mid,w)) {low = mid; continue;}
        }

        high = mid;
    }

    return mid;
}

int main(void){
    int N,K,i;
    point A,B,P;
    double a,w;

    cin >> A.x >> A.y >> B.x >> B.y;
    cin >> N;

    vector <double> v;
    REP(i,N){
        cin >> P.x >> P.y >> a >> w;
        double tmp = func(A,B,P,a,w);
        v.push_back(tmp);
    }

    cin >> K;
    v.push_back(0.0);
    sort(v.begin(),v.end());
    double ans = v[N-K];

    printf("%.6f\n",ans);

    return 0;
}

#include <map>
#include <set>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
#define li              long long
#define rep(i,to)       for(li i=0;i<((li)to);i++)
#define pb              push_back
#define sz(v)           ((li)v.size())
double cal_ang(double x,double y){
        double res=acos(abs(x/hypot(x,y)));
        if(x<=0 && y>=0) return acos(-1)-res;
        if(x<=0 && y<0) return acos(-1)+res;
        if(x>0 && y<0) return acos(-1)*2.0-res;
        return res;
}

int main(){
        double x0,x1,y0,y1,t0,t1,t2,t3;
        int n,k;
        vector<double> time;
        scanf("%lf%lf%lf%lf%d",&x0,&y0,&x1,&y1,&n);
        rep(i,n){
                scanf("%lf%lf%lf%lf",&t0,&t1,&t2,&t3);
                if(t3<1e-5) continue;
                x0-=t0; x1-=t0; y0-=t1; y1-=t1;
                double tmp=0;
                #define NUM 100
                rep(j,NUM+1){
                        double x=x0+(x1-x0)*j/(double)NUM;
                        double y=y0+(y1-y0)*j/(double)NUM;
                        double ang=cal_ang(x,y);
                        ang-=t2;
                        if(ang<0) ang+=2.0*acos(-1);
                        while(ang>acos(-1)*2.0) ang-=acos(-1)*2.0;
                        ang=min(acos(-1)*2.0-ang,ang);
                        tmp=max(tmp,hypot(x0-x,y0-y)/(ang/t3));
                }
                time.pb(tmp);
                x0+=t0; x1+=t0; y0+=t1; y1+=t1;
        }
        scanf("%d",&k);
        if(sz(time)<=k){
                printf("0.0000\n");
                return 0;
        }
        sort(time.begin(),time.end());
        reverse(time.begin(),time.end());
        printf("%.4lf\n",time[k]);
}

#include <map>
#include <set>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
#define li		long long
#define rep(i,to)	for(li i=0;i<((li)to);i++)
#define pb		push_back
#define sz(v)		((li)v.size())
double cal_ang(double x,double y){
	double res=acos(abs(x/hypot(x,y)));
	if(x<=0 && y>=0) return acos(-1)-res;
	if(x<=0 && y<0) return acos(-1)+res;
	if(x>0 && y<0) return acos(-1)*2.0-res;
	return res;
}

int main(){
	double x0,x1,y0,y1,t0,t1,t2,t3;
	int n,k;
	vector<double> time;
	scanf("%lf%lf%lf%lf%d",&x0,&y0,&x1,&y1,&n);
	rep(i,n){
		scanf("%lf%lf%lf%lf",&t0,&t1,&t2,&t3);
		if(t3<1e-5) continue;
		x0-=t0; x1-=t0; y0-=t1; y1-=t1;
		double tmp=0;
		#define NUM 100
		rep(j,NUM+1){
			double x=x0+(x1-x0)*j/(double)NUM;
			double y=y0+(y1-y0)*j/(double)NUM;
			double ang=cal_ang(x,y);
			ang-=t2;
			if(ang<0) ang+=2.0*acos(-1);
			while(ang>acos(-1)*2.0) ang-=acos(-1)*2.0;
			ang=min(acos(-1)*2.0-ang,ang);
			tmp=max(tmp,hypot(x0-x,y0-y)/(ang/t3));
		}
		time.pb(tmp);
		x0+=t0; x1+=t0; y0+=t1; y1+=t1;
	}
	scanf("%d",&k);
	if(sz(time)<=k){
		printf("0.0000\n");
		return 0;
	}
	sort(time.begin(),time.end());
	reverse(time.begin(),time.end());
	printf("%.4lf\n",time[k]);
}

#include <algorithm>
#include <iostream>
#include <sstream>
#include <complex>
#include <numeric>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

#define all(a)			(a).begin(), (a).end()
#define sz(a)			int((a).size())
#define FOR(i, a, b)	for (int i(a); i < b; ++i)
#define REP(i, n)		FOR(i, 0, n)
#define UN(v)			sort(all(v)), (v).erase(unique((v).begin(), (v).end()), (v).end())
#define CL(a, b)		memset(a, b, sizeof a)
#define pb				push_back
#define X				first
#define Y				second

typedef long long ll;
typedef vector <int> vi;
typedef pair <int, int> pii;

const double pi2 = acos(-1.0) * 2;

double g(double x, double y, double a, double v) {
	double c = atan2(y, x) - a;
	for (; c >= pi2; c -= pi2);
	for (; c < 0; c += pi2);
	return min(c, pi2 - c) / v;
}

double f(double x0, double y0, double x1, double y1, double a, double v) {
	double dx = x1 - x0, dy = y1 - y0, d = sqrt(dx * dx + dy * dy);
	double res = 1 / g(x1, y1, a, v);
	for (double t = 1e-4; t < 1; t += 2e-4)
		res = max(res, t / g(x0 + dx * t, y0 + dy * t, a, v));
	double L = 1e-4, R = 1, l, r, fl, fr;
	REP (k, 256) {
		l = (L * 2 + R) / 3;
		r = (L + R * 2) / 3;
		fl = l / g(x0 + dx * l, y0 + dy * l, a, v);
		fr = r / g(x0 + dx * r, y0 + dy * r, a, v);
		if (fl < fr) {
			res = max(res, fr);
			L = l;
		} else {
			res = max(res, fl);
			R = r;
		}
	}
	return d * res;
}

int main(){
	#ifdef LocalHost
	freopen("x.in", "r", stdin);
	freopen("x.out", "w", stdout);
	#endif
	double Ax, Ay, Bx, By;
	int n;
	cin >> Ax >> Ay >> Bx >> By >> n;
	vector <double> v;
	REP (i, n) {
		double x, y, a, w;
		scanf("%lf%lf%lf%lf", &x, &y, &a, &w);
		v.pb(f(Ax - x, Ay - y, Bx - x, By - y, a, w));
	}
	sort(v.rbegin(), v.rend());
	v.pb(0);
	cin >> n;
	printf("%.12lf\n", v[n]);
	return 0;
}

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>

#define y1 y3223789

using namespace std;

const int MAXN = 10000;

int n;
double x1, y1, 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 y1, double x2, double y2) {
    return x1 * y2 - x2 * y1;
}

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 y1, double x2, double y2, double x3, double y3, double x4, double y4) {
    double d = cross(x2 - x1, y2 - y1, x3 - x4, y3 - y4);
    double p = cross(x2 - x1, y2 - y1, x3 - x1, y3 - y1);
    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 = y1 * (1 - c1) + y2 * c1;
        double cx2 = x1 * (1 - c2) + x2 * c2;
        double cy2 = y1 * (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 - y1) * (y2 - y1)) / v;
    for (int i = 0; i < n; i++)
        if (check(i, v))
            ans++;
    return ans;
}

int main() {
//  freopen("tanks.in", "r", stdin);
//  freopen("tanks.out", "w", stdout);

    cin >> x1 >> y1 >> x2 >> y2;
    double dist = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
    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] - y1, x[i] - x2, y[i] - y2);
        t1[i] = get_time(i, x1, y1);
        t2[i] = get_time(i, x2, y2);
        p[i] = inter(x[i], y[i], x[i] + y2 - y1, y[i] + x1 - x2, x1, y1, 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;
}

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>

#define y1 y3223789

using namespace std;

const int MAXN = 10000;

int n;
double x1, y1, 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 y1, double x2, double y2) {
    return x1 * y2 - x2 * y1;
}

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 y1, double x2, double y2, double x3, double y3, double x4, double y4) {
    double d = cross(x2 - x1, y2 - y1, x3 - x4, y3 - y4);
    double p = cross(x2 - x1, y2 - y1, x3 - x1, y3 - y1);
    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 < 40; o++) {
        double c1 = (l * 2 + r) / 3;
        double c2 = (l + 2 * r) / 3;
        double cx1 = x1 * (1 - c1) + x2 * c1;
        double cy1 = y1 * (1 - c1) + y2 * c1;
        double cx2 = x1 * (1 - c2) + x2 * c2;
        double cy2 = y1 * (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 - y1) * (y2 - y1)) / v;
    for (int i = 0; i < n; i++)
        if (check(i, v))
            ans++;
    return ans;
}

int main() {
//  freopen("tanks.in", "r", stdin);
//  freopen("tanks.out", "w", stdout);

    cin >> x1 >> y1 >> x2 >> y2;
    double dist = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
    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] - y1, x[i] - x2, y[i] - y2);
        t1[i] = get_time(i, x1, y1);
        t2[i] = get_time(i, x2, y2);
        p[i] = inter(x[i], y[i], x[i] + y2 - y1, y[i] + x1 - x2, x1, y1, x2, y2);
        d[i] = abs(tmp) / dist;
    }

    int k;
    cin >> k;

    double tt[MAXN];

    for (int i = 0; i < n; i++) {
        double l = 0, r = 4000000;
        while (r - l > 1e-5) {
            double v = (l + r) / 2;
            nt = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)) / v;
            if (check(i, v))
                l = v;
            else
                r = v;
        }
        tt[i] = (l + r) / 2;
    }

    sort(tt, tt + n);
    reverse(tt, tt + n);
    if (k == n)
        printf("%.4lf", 0.0);
    else
        printf("%.4lf", tt[k]);
    cout << endl;

    return 0;
}

#include <iostream>
#include <complex>
#include <cmath>
#include <vector>
#include <algorithm>

using namespace std;

typedef complex<double> point;

double prodvec(point p1,point p2)
{
  return imag(conj(p1)*p2);
}

double prodesc(point p1,point p2)
{
  return real(conj(p1)*p2);
}

const int limite=20000;

double error=1e-7;

double computa(point p,point direccion,double w,double b)
{
  point pb(b,0);
  double tb=abs(arg((pb-p)/direccion))/w;
  double sol=b/tb;
  //cout<<"--- "<<sol<<endl;
  double x=real(p);
  double y=imag(p);
  if (x<=0) return sol;
  double inf=sol;
  double sup=1000000000;
  while (inf+error<sup) {
    double med=(inf+sup)/2.0;
    if (med*y/w<y*y) {
      sup=med;
    } else {
      point corte(x-sqrt(med*y/w-y*y),0.0);
      if (real(corte)<0 or real(corte)>b)
	sup=med;
      else {
	double t=abs(arg((corte-p)/direccion))/w;
	double tt=real(corte)/med;
	if (tt<t) sup=med;
	else inf=med;
      }
    }
  }
  //cout<<inf<<endl;
  return inf;
}

point pa,pb;
int n;
point p[100000];
point vp[100000];
double w[100000];
int k;

point leer()
{
  double x,y;
  cin>>x>>y;
  return point(x,y);
}

int main()
{
  cout.setf(ios::fixed);
  cout.precision(10);
  pa=leer();
  pb=leer();
  point divi=pb-pa;
  divi=divi/abs(divi);
  cin>>n;
  vector<double> v;
  for (int i=0;i<n;i++) {
    p[i]=leer();
    double a;
    cin>>a;
    vp[i]=polar(1.0,a);
    cin>>w[i];
    p[i]-=pa;
    p[i]=p[i]/divi;
    vp[i]=vp[i]/divi;
    if (imag(p[i])<0) {
      p[i]=conj(p[i]);
      vp[i]=conj(vp[i]);
    }
    v.push_back(computa(p[i],vp[i],w[i],abs(pb-pa)));
  }
  cin>>k;
  sort(v.begin(),v.end());
  if (k>=int(v.size())) cout<<0.0<<endl;
  else cout<<v[int(v.size())-1-k]<<endl;
}

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

template<class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
using namespace std;
/***********************************************/
/* Dear online judge:
 * I've read the problem, and tried to solve it.
 * Even if you don't accept my solution, you should respect my effort.
 * I hope my code compiles and gets accepted.
 *  ___  __     _______    _______
 * |\  \|\  \  |\  ___ \  |\  ___ \
 * \ \  \/  /|_\ \   __/| \ \   __/|
 *  \ \   ___  \\ \  \_|/__\ \  \_|/__
 *   \ \  \\ \  \\ \  \_|\ \\ \  \_|\ \
 *    \ \__\\ \__\\ \_______\\ \_______\
 *     \|__| \|__| \|_______| \|_______|
 */
const long long mod = 1000000007;

const long double INF = 1e100;
const long double EPS = 1e-12;

const long double PI = acosl(-1.0);

struct PT {
	long double x, y;
	PT() :
		x(0), y(0) {
	}
	PT(long double _x, long double _y) :
		x(_x), y(_y) {
	}
	PT(const PT &p) :
		x(p.x), y(p.y) {
	}
	PT operator +(const PT &p) const {
		return PT(x + p.x, y + p.y);
	}
	PT operator -(const PT &p) const {
		return PT(x - p.x, y - p.y);
	}
	PT operator *(long double c) const {
		return PT(x * c, y * c);
	}
	PT operator /(long double c) const {
		return PT(x / c, y / c);
	}
	bool operator<(const PT &p) const {
		return make_pair(x, y) < make_pair(p.x, p.y);
	}

	bool operator==(const PT &p) const {
		return fabsl(x - p.x) > EPS || fabsl(y - p.y) > EPS;
	}
};
long double dot(PT p, PT q) {
	return p.x * q.x + p.y * q.y;
}
long double dist2(PT p, PT q) {
	return dot(p - q, p - q);
}
long double cross(PT p, PT q) {
	return p.x * q.y - p.y * q.x;
}
PT norm(PT x, long double l)    { return x * sqrt(l*l / dot(x,x));}
istream &operator>>(istream &is, PT &p) {
	return is >> p.x >> p.y;
}
ostream &operator<<(ostream &os, const PT &p) {
	return os << "(" << p.x << "," << p.y << ")";
}
/*around the origin*/
PT RotateCCW90(PT p) {
	return PT(-p.y, p.x);
}
PT RotateCW90(PT p) {
	return PT(p.y, -p.x);
}
PT RotateCCW(PT p, long double t) {
	return PT(p.x*cos(t)-p.y*sin(t), p.x*sin(t)+p.y*cos(t));
}
// project point c onto line through a and b (assuming a != b)
PT ProjectPointLine(PT a, PT b, PT c) {
	return a + (b-a)*dot(c-a, b-a)/dot(b-a, b-a);
}
// project point c onto line segment through a and b (assuming a != b)
PT ProjectPointSegment(PT a, PT b, PT c) {
	long double r = dot(c-a, b-a)/dot(b-a,b-a);
	if (r < 0) return a;
	if (r > 1) return b;
	return a + (b-a)*r;
}

PT A,B;

long double F(long double x, PT a, long double v, long double an) {
	PT to = norm(B-A, x) + A;
	long double tob = atan2l(to.y - a.y,to.x - a.x);
	if(tob < 0) tob += 2 * PI;
	tob = min(fabsl(tob-an), 2 * PI - fabsl(tob-an));
	return x * v / tob;
}

int main(int argc, char** argv) {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	cout<<fixed<<setprecision(7);

	int N,K;
	cin>>A>>B>>N;
	PT a;
	long double an;
	long double v;
	vector<long double> t(N);

	for(int i = 0;i < N;i++) {
		cin>>a>>an>>v;
		long double tob = atan2l(B.y - a.y,B.x - a.x);
		if(tob < 0) tob += 2 * PI;
		t[i] = fminl(fabsl(tob-an), 2*PI - fabsl(tob-an)) / v;
		PT proj = ProjectPointSegment(A,B,a);
		long double lo = 0,hi = sqrtl(dist2(proj,A));
		for(int k = 0;k < 100;k++) {
			long double md1 = (2*lo+hi) / 3;
			long double md2 = (lo+2*hi) / 3;
			long double v1 = F(md1, a, v, an);
			long double v2 = F(md2, a, v, an);
			if(v1 <= v2) lo = md1;
			else hi = md2;
		}
		long double vt = F((lo+hi)/2, a, v, an);
		t[i] = fminl(t[i], sqrtl(dist2(B,A))/vt);
	}

	cin>>K;
	if(K == N) {
		cout<<"0\n";
		return 0;
	}

	sort(t.begin(),t.end());
	cout<<sqrtl(dist2(A,B))/t[K]<<'\n';
	return 0;
}

#include <map>
#include <set>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
#define li long long
#define rep(i, to) for (li i = 0; i < ((li)to); i++)
#define pb push_back
#define sz(v) ((li)v.size())
double cal_ang(double x, double y) {
  double res = acos(abs(x / hypot(x, y)));
  if (x <= 0 && y >= 0) return acos(-1) - res;
  if (x <= 0 && y < 0) return acos(-1) + res;
  if (x > 0 && y < 0) return acos(-1) * 2.0 - res;
  return res;
}

int main() {
  double x0, x1, y0, y1, t0, t1, t2, t3;
  int n, k;
  vector<double> time;
  scanf("%lf%lf%lf%lf%d", &x0, &y0, &x1, &y1, &n);
  rep(i, n) {
    scanf("%lf%lf%lf%lf", &t0, &t1, &t2, &t3);
    if (t3 < 1e-5) continue;
    x0 -= t0;
    x1 -= t0;
    y0 -= t1;
    y1 -= t1;
    double tmp = 0;
#define NUM 100
    rep(j, NUM + 1) {
      double x = x0 + (x1 - x0) * j / (double)NUM;
      double y = y0 + (y1 - y0) * j / (double)NUM;
      double ang = cal_ang(x, y);
      ang -= t2;
      if (ang < 0) ang += 2.0 * acos(-1);
      while (ang > acos(-1) * 2.0) ang -= acos(-1) * 2.0;
      ang = min(acos(-1) * 2.0 - ang, ang);
      tmp = max(tmp, hypot(x0 - x, y0 - y) / (ang / t3));
    }
    time.pb(tmp);
    x0 += t0;
    x1 += t0;
    y0 += t1;
    y1 += t1;
  }
  scanf("%d", &k);
  if (sz(time) <= k) {
    printf("0.0000\n");
    return 0;
  }
  sort(time.begin(), time.end());
  reverse(time.begin(), time.end());
  printf("%.4lf\n", time[k]);
}

#include <bits/stdc++.h>
#define EPS 1e-6
#define PI acos(-1)
using namespace std;

typedef long long ll;//GuGuGuGuGuGuGuGuGuGuGuGu aqwertyuiop
//asdfghjkl
//zxcvbnm

int n,m,k;

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 - EPS || (x < o.x + EPS && y < o.y - EPS); }
};

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) < EPS) continue;
        Point p = {x,y}; double v=-2;
        for(int j=0;j<=100;j++){
            Point tp = (B-A)*(j/100.0) + A;
            double arg = (tp-p).arg() -a;
            if(arg>2*PI) arg-=2*PI;
            while(arg < 0) arg += 2 * PI;
            if (arg>2*PI-arg) arg = 2*PI-arg;
            double t = arg/w;
            v = v<-1 ? (tp-A).abs()/t : max(v, (tp-A).abs()/t);
        }
        js[v]++;
    }
    scanf("%d", &k);
    int sk = 0; double t=-10;
    for(map<double, int>::reverse_iterator it=js.rbegin(); it!= js.rend(); it++) {
        if (sk + it->second > k) {
            t = it->first;
            break;
        }
        sk += it->second;
    }
    printf("%.4lf\n", t<-1 ? 0 : t);
    return 0;
}

#include <bits/stdc++.h>
#define EPS 1e-6
#define PI acos(-1)
using namespace std;

typedef long long ll;

int n,m,k;

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 - EPS || (x < o.x + EPS && y < o.y - EPS); }
};

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) < EPS) continue;
        Point p = {x,y}; double v=-2;
        for(int j=0;j<=100;j++){
            Point tp = (B-A)*(j/100.0) + A;
            double arg = (tp-p).arg() -a;
            if(arg>2*PI) arg-=2*PI;
            while(arg < 0) arg += 2 * PI;
            if (arg>2*PI-arg) arg = 2*PI-arg;
            double t = arg/w;
            v = v<-1 ? (tp-A).abs()/t : max(v, (tp-A).abs()/t);
        }
        js[v]++;
    }
    scanf("%d", &k);
    int sk = 0; double t=-10;
    for(map<double, int>::reverse_iterator it=js.rbegin(); it!= js.rend(); it++) {
        if (sk + it->second > k) {
            t = it->first;
            break;
        }
        sk += it->second;
    }
    printf("%.4lf\n", t<-1 ? 0 : t);
    return 0;
}

//lxrtxdy!
#include <map>
#include <set>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
#define li		long long
#define rep(i,to)	for(li i=0;i<((li)to);i++)
#define pb		push_back
#define sz(v)		((li)v.size())
double cal_ang(double x,double y){
	double res=acos(abs(x/hypot(x,y)));
	if(x<=0 && y>=0) return acos(-1)-res;
	if(x<=0 && y<0) return acos(-1)+res;
	if(x>0 && y<0) return acos(-1)*2.0-res;
	return res;
}

int main(){
	double x0,x1,y0,y1,t0,t1,t2,t3;
	int n,k;
	vector<double> time;
	scanf("%lf%lf%lf%lf%d",&x0,&y0,&x1,&y1,&n);
	rep(i,n){
		scanf("%lf%lf%lf%lf",&t0,&t1,&t2,&t3);
		if(t3<1e-5) continue;
		x0-=t0; x1-=t0; y0-=t1; y1-=t1;
		double tmp=0;
		#define NUM 100
		rep(j,NUM+1){
			double x=x0+(x1-x0)*j/(double)NUM;
			double y=y0+(y1-y0)*j/(double)NUM;
			double ang=cal_ang(x,y);
			ang-=t2;
			if(ang<0) ang+=2.0*acos(-1);
			while(ang>acos(-1)*2.0) ang-=acos(-1)*2.0;
			ang=min(acos(-1)*2.0-ang,ang);
			tmp=max(tmp,hypot(x0-x,y0-y)/(ang/t3));
		}
		time.pb(tmp);
		x0+=t0; x1+=t0; y0+=t1; y1+=t1;
	}
	scanf("%d",&k);
	if(sz(time)<=k){
		printf("0.0000\n");
		return 0;
	}
	sort(time.begin(),time.end());
	reverse(time.begin(),time.end());
	printf("%.4lf\n",time[k]);
}
//hellobig_tq
//orzlxr!

#include <map>
#include <set>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
#define li		long long
#define rep(i,to)	for(li i=0;i<((li)to);i++)
#define pb		push_back
#define sz(v)		((li)v.size())
double cal_ang(double x,double y){
	double res=acos(abs(x/hypot(x,y)));
	if(x<=0 && y>=0) return acos(-1)-res;
	if(x<=0 && y<0) return acos(-1)+res;
	if(x>0 && y<0) return acos(-1)*2.0-res;
	return res;
}

int main(){
	double x0,x1,y0,y1,t0,t1,t2,t3;
	int n,k;
	vector<double> time;
	scanf("%lf%lf%lf%lf%d",&x0,&y0,&x1,&y1,&n);
	rep(i,n){
		scanf("%lf%lf%lf%lf",&t0,&t1,&t2,&t3);
		if(t3<1e-5) continue;
		x0-=t0; x1-=t0; y0-=t1; y1-=t1;
		double tmp=0;
		#define NUM 100
		rep(j,NUM+1){
			double x=x0+(x1-x0)*j/(double)NUM;
			double y=y0+(y1-y0)*j/(double)NUM;
			double ang=cal_ang(x,y);
			ang-=t2;
			if(ang<0) ang+=2.0*acos(-1);
			while(ang>acos(-1)*2.0) ang-=acos(-1)*2.0;
			ang=min(acos(-1)*2.0-ang,ang);
			tmp=max(tmp,hypot(x0-x,y0-y)/(ang/t3));
		}
		time.pb(tmp);
		x0+=t0; x1+=t0; y0+=t1; y1+=t1;
	}
	scanf("%d",&k);
	if(sz(time)<=k){
		printf("0.0000\n");
		return 0;
	}
	sort(time.begin(),time.end());
	reverse(time.begin(),time.end());
	printf("%.4lf\n",time[k]);
}
//hellobig_tq

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <cmath>
#include <set>
#include <map>
#include <cstdio>
#include <stdlib.h>
#include <stack>
#include <numeric>
#include <bitset>
typedef long long ll;
#define MAX 105
using namespace std;
int n,m,k;
#define INF 2147483647
#define MOD 1000000007
#define EPS 1e-6
#define G 9.8
#define PI acos(-1)
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 - EPS || (x < o.x + EPS && y < o.y - EPS); }
};
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) < EPS) continue;
        Point p = {x,y}; double v=-2;
        for(int j=0;j<=100;j++)
        {
            Point tp = (B-A)*(j/100.0) + A;
            double arg = (tp-p).arg() -a;
            if(arg>2*PI) arg-=2*PI;
            while(arg < 0) arg += 2 * PI;
            if (arg>2*PI-arg) arg = 2*PI-arg;
            double t = arg/w;
            v = v<-1 ? (tp-A).abs()/t : max(v, (tp-A).abs()/t);
        }
        js[v]++;
    }
    scanf("%d", &k);
    int sk = 0; double t=-10;

    for(map<double, int>::reverse_iterator it=js.rbegin(); it!= js.rend(); it++) {
        if (sk + it->second > k) {
            t = it->first;
            break;
        }
        sk += it->second;
    }
    printf("%.4lf\n", t<-1 ? 0 : t);
    return 0;
}

#include <map>
#include <set>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
#define li		long long
#define rep(i,to)	for(li i=0;i<((li)to);i++)
#define pb		push_back
#define sz(v)		((li)v.size())
double cal_ang(double x,double y){
	double res=acos(abs(x/hypot(x,y)));
	if(x<=0 && y>=0) return acos(-1)-res;
	if(x<=0 && y<0) return acos(-1)+res;
	if(x>0 && y<0) return acos(-1)*2.0-res;
	return res;
}

int main(){
	double x0,x1,y0,y1,t0,t1,t2,t3;
	int n,k;
	vector<double> time;
	scanf("%lf%lf%lf%lf%d",&x0,&y0,&x1,&y1,&n);
	rep(i,n){
		scanf("%lf%lf%lf%lf",&t0,&t1,&t2,&t3);
		if(t3<1e-5) continue;
		x0-=t0; x1-=t0; y0-=t1; y1-=t1;
		double tmp=0;
		#define NUM 100
		rep(j,NUM+1){
			double x=x0+(x1-x0)*j/(double)NUM;
			double y=y0+(y1-y0)*j/(double)NUM;
			double ang=cal_ang(x,y);
			ang-=t2;
			if(ang<0) ang+=2.0*acos(-1);
			while(ang>acos(-1)*2.0) ang-=acos(-1)*2.0;
			ang=min(acos(-1)*2.0-ang,ang);
			tmp=max(tmp,hypot(x0-x,y0-y)/(ang/t3));
		}
		time.pb(tmp);
		x0+=t0; x1+=t0; y0+=t1; y1+=t1;
	}
	scanf("%d",&k);
	if(sz(time)<=k){
		printf("0.0000\n");
		return 0;
	}
	sort(time.begin(),time.end());
	reverse(time.begin(),time.end());
	printf("%.4lf\n",time[k]);
	return 0;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
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;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
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);
		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;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
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);
		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<50;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;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
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);
		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<50;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=3e6;
    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;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
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;
      //  theta=atan2(en.y-st.y,en.x-st.x)-atan2(tank[i].y-st.y,tank[i].x-st.x);
      //  norm(theta);
       // if(theta<0)
     //      theta=-theta;
       // if(theta>pi/2)
         //    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;
		    	}
		}
      //  if(nk>k)
       //    return false;
    }
    if(v==8)
       printf("nk=%d\n",nk);
    return nk<=k;
}
int main()
{
    int i,j,s,p,q;
    double low,high,mid;
   // st.x=rand()%100;
   // st.y=rand()%100;
   // en.x=rand()%100;
   // en.y=rand()%100;
	scanf("%lf%lf%lf%lf",&st.x,&st.y,&en.x,&en.y);
    //n=5;
	scanf("%d",&n);
    for(i=0;i<n;i++)
    {
    //	tank[i].x=rand();
    //	tank[i].y=rand();
    //	tank[i].a=rand();
    //	tank[i].w=rand()%100;
       scanf("%lf%lf%lf%lf",&tank[i].x,&tank[i].y,&tank[i].a,&tank[i].w);
       norm(tank[i].a);
    }
   // k=rand()%(n+1);
   // printf("%d\n",n);
//	printf("%.0f %.0f %.0f %.0f\n",st.x,st.y,en.x,en.y);
   // //for(i=0;i<n;i++)
    //   printf("%.0f %.0f %.0f %.0f\n",tank[i].x,tank[i].y,tank[i].a,tank[i].w);
  //  printf("%d\n",k);
    scanf("%d",&k);
   // printf("orz=%d\n",check(8));
    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;
}
/*
41 67 34 0
5
19169 15724 -1 58
26962 24464 -0 45
23281 16827 2 91
2995 11942 2 36
32391 14604 0 53
4
*/

#include <stdio.h>
#include <tchar.h>
#include<cmath>
#include<valarray>
#include<algorithm>
#include<functional>
#include<list>
#include<vector>
#include<map>
#include<iostream>

using namespace std;

typedef pair<double,double> Para;

int N;
int K;
Para A;
Para B;
const double pi=3.141592653589;
double H,L,W,T0,Fi;

valarray<double> tanks;

double rad(Para p1, Para p2);
double cosinus(Para,Para,Para);
Para ortohonal(Para p);

void Init();
double VeDec(double t1,double t2);
double TestVelocity(Para p1,Para p2,Para x);
double MakeSolution();

int _tmain(int argc, _TCHAR* argv[])
{
    //::freopen("stdin.txt","r",stdin);

    Init();
    double V=MakeSolution();
    printf("%.4lf\n",V);
    return 0;
}

void Init()
{
    double v1,v2,v3,x,y,alfa;
    cin>>x>>y; A=make_pair(x,y);
    cin>>x>>y; B=make_pair(x,y);
    cin>>N;
    tanks.resize(N);
    double D=hypot(B.first-A.first, B.second-A.second);
    Para p;
    for(int i=0;i<N;i++)
    {
        cin>>p.first>>p.second;
        cin>>alfa>>W;
        double a1=abs(alfa-rad(p,A));
        double a2=abs(alfa-rad(p,B));
        a1=min(a1,2*pi-a1);
        a2=min(a2,2*pi-a2);
        v1=(D*W)/a2;
        v2=v3=0;
        T0=a1/W;
        double Phi=acos(cosinus(A,p,B));
        if(cosinus(p,A,B)<=0)
        {
            v3=D/(T0+(Phi/W));
        }
        else
        {
            Para M=ortohonal(p);
            H=hypot(M.first-p.first,M.second-p.second);
            L=hypot(M.first-A.first,M.second-A.second);
            Fi=acos(cosinus(A,p,M));
            if(cosinus(p,B,A)<=0)
            {
                v2=VeDec(T0,T0+(Phi/W));
               // double _v2=TestVelocity(A,B,p);
            }
            else
            {
                double t2=T0+Fi/W;
               // double v22=TestVelocity(A,M,p);
                v2=VeDec(T0,t2);
                v3=D/(T0+(Phi)/W);
            }
        }
        tanks[i]=max(v1,max(v2,v3));
    }
    sort(&tanks[0],&tanks[N],std::greater<double>());
    cin>>K;
}

double MakeSolution()
{
    if(K==N) return 0;
    for(int i=K;i>0;i--)
    {
        if(tanks[i]!=tanks[i-1]) return tanks[i];
    }
    return tanks[0];
}

double rad(Para p1, Para p2)
{
    double x=p2.first-p1.first;
    double y=p2.second-p1.second;
    double t=y/x;
    double q=(t>0)?atan(t):pi-atan(abs(t));
    if(y<0) return pi+q;
    if(y==0)return (x>0)?0:pi;
    return q;
}

double cosinus(Para p1,Para p0,Para p2)
{
    double d1=hypot(p1.first-p0.first,p1.second-p0.second);
    double d2=hypot(p2.first-p0.first,p2.second-p0.second);
    double t=((p1.first-p0.first)*(p2.first-p0.first)+(p1.second-p0.second)*(p2.second-p0.second))/(d1*d2);
    return t;
}

Para ortohonal(Para p)
{
    double k=(B.second-A.second)/(B.first-A.first);
    if(k==0) return Para(p.first,A.second);
    Para Z((k*(p.second-A.second)+k*k*A.first+p.first)/(k*k+1),0);
    Z.second=k*Z.first+A.second-k*A.first;
    return Z;
}

double VeDec(double t1,double t2)
{
    double x=L-H*tan(Fi-W*(t1-T0));
    double V1=(L-H*tan(Fi-W*(t1-T0)))/t1;
    double V2=(L-H*tan(Fi-W*(t2-T0)))/t2;
    if(abs(V2-V1)<0.0001) return V1;
    double t0=(t2+t1)/2;
    double delt=t0-0.5*(L*(1+cos(2*(Fi-W*(t0-T0))))/(H*W)-sin(2*(Fi-W*(t0-T0)))/W);
    if(delt<0) return VeDec(t1,t0);
    if(delt>0) return VeDec(t0,t2);
    if(delt==0) return (H*W)/pow(cos(Fi-W*(t0-T0)),2);
}

double TestVelocity(Para p1,Para p2,Para r)
{
    double tmp=0;
    for(int i=0;i<=1000;i++)
    {
        double x=p1.first+(p2.first-p1.first)*i/1000.;
        double y=p1.second+(p2.second-p1.second)*i/1000.;
        double phi=std::acos(cosinus(p1,r,make_pair(x,y)));
        double time=T0+(phi/W);
        tmp=max(tmp,hypot(x-p1.first,y-p1.second)/time);
    }
    return tmp;
}

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<set>
#include<vector>
#include<map>
#include<queue>
#include<string>
#include<bitset>
#include<iomanip>
#include<iostream>
#include<cmath>
using namespace std;
#define rep(i,x,y) for(i=x;i<=y;i++)
#define _rep(i,x,y) for(i=x;i>=y;i--)
#define REP(i,x,y) for(int i=(x);i<=(y);i++)
#define _REP(i,x,y) for(int i=(x);i>=(y);i--)
#define CL(S,x) memset(S,x,sizeof(S))
#define CP(S1,S2) memcpy(S1,S2,sizeof(S2))
#define ALL(x,S) for(__typeof((v).end()) x=S.begin();x!=S.end();x++)
#define pb push_back
#define IN insert
#define ER erase
#define BE begin()
#define ED end()
#define LB lower_bound
#define UB upper_bound
#define mp make_pair
#define fi first
#define se second
#define upmin(x,y) x=min(x,y)
#define upmax(x,y) x=max(x,y)
#define COUT(S,x) cout<<fixed<<setprecision(x)<<S<<endl
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;}

typedef long long ll;
typedef double ld;
typedef pair<int,int> pii;

const ld pi=2*acos(0);
struct node{ld x,y;};
void read(node&a){read(a.x,a.y);}
int sgn(ld 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,ld x){return(node){a.x*x,a.y*x};}
node operator/(node a,ld 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};}
ld operator*(node a,node b){return a.x*b.y-a.y*b.x;}
ld xj(node a,node b,node c){return (b-a)*(c-a);}
ld 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;ld L,R;
node A,B,C,D;ld alp,w,a[11111];

const int W=2000;
int main()
{
    //freopen("1.in","r",stdin);freopen("1.out","w",stdout);
    read(A);read(B);
    read(n);
    rep(i,1,n)
    {
        read(C);
        scanf("%lf%lf",&alp,&w);
        ld vmax=0,z;
        REP(cnt,0,W)
        {
            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;
            upmax(vmax,len(D-A)/(z/w+1e-12));
        }
        a[i]=vmax;
    }
    read(K);sort(a+1,a+1+n);COUT(a[n-K],10);
    return 0;
}

   #include <cstdio>
   #include <vector>
   #include <algorithm>
   #include <cmath>
   using namespace std;
   #define x first
   #define y second
   typedef double dbl;
   typedef pair <dbl, dbl> pnt;
   pnt operator - (pnt a, pnt b) {
     return pnt (a.x - b.x, a.y - b.y);
   }
   pnt st, dir;
   dbl _w, _s, _len;
   inline dbl f(dbl t) {
     dbl x = st.x + dir.x * t,
         y = st.y + dir.y * t;
     dbl r = atan2 (y, x) - _s;
     while (r < 0) {
       r += 2 * M_PI;
     }
     while (r > 2 * M_PI) {
       r -= 2 * M_PI;
     }
   //  fprintf (stderr,  "%lf : %lf (%lf %lf) | %lf\n", _len * t * _w, min(r, 2 * M_PI - r), x, y, r);
     return _len * t * _w / min(r, 2 * M_PI - r);
   }
   dbl get (pnt a, pnt b, dbl s, dbl w) {
     st = a;
     dir = b - a;
     _s = s;
     _w = w;
     _len = hypot (dir.x, dir.y);
     dbl res = 0;
     for (int i = 0; i <= 200; i++) {
       dbl t = f (i / 200.);
       if (t > res) {
         res = t;
       }
     }
     return res;
   }
   void read (pnt &p) {
     double x, y;
     scanf ("%lf%lf", &x, &y);
     p.x = x;
     p.y = y;
   }
   int main (void) {
     pnt a, b;
     read(a);
     read(b);
     int n;
     scanf ("%d", &n);
     vector <dbl> v(1, 0);
     for (int i = 0; i < n; i++) {
       pnt p;
       read(p);
       double s, w;
       scanf("%lf%lf", &s, &w);
       v.push_back(get(a - p, b - p, s, w));
     }
     sort (v.begin(), v.end());
     reverse (v.begin(), v.end());
     int k;
     scanf ("%d", &k);
     printf ("%.20lf\n", v[k]);
     return 0;
   }

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long LL;
const double EPS = 1e-9, INF = 1e15, PI = acos(-1.0);
#define FOR(i,s,e) for(int i=s;i<e;i++)
#define flt(x,y) ((x)<(y)-EPS)
#define fgt(x,y) flt(y,x)
#define fle(x,y) !fgt(x,y)
#define fge(x,y) !flt(x,y)
#define feq(x,y) (fabs((x)-(y))<EPS)

#define chkMn(x,y) x=min(x,y)
#define chkMx(x,y) x=max(x,y)

double sq(double x) { return x*x; }

struct P{
        double x, y;
        P(){ }
        P(double x,double y):x(x),y(y){ }
        void eat(){ scanf("%lf%lf",&x,&y); }
        P operator+(const P &p)const{ return P(x+p.x, y+p.y); }
        P operator-(const P &p)const{ return P(x-p.x, y-p.y); }
        P operator*(double k){ return P(x*k, y*k); }
        double operator*(P p){ return x*p.x + y*p.y; }
        double operator^(P p){ return x*p.y - y*p.x; }
        double mag2() { return x*x+y*y; }
        double mag(){ return sqrt(mag2()); }
        bool operator<(const P &p)const {
                if (feq(x,p.x)) return flt(y,p.y);
                return flt(x,p.x);
        }
        bool operator==(const P &p)const {
                return feq(x,p.x) && feq(y,p.y);
        }
        P rot(){ return P(-y,x); }
        P rot(double the) {
                return P(x*cos(the)-y*sin(the), x*sin(the)+y*cos(the));
        }
        P nor(){
                if (feq(mag(),0))       return *this;
                return *this*(1./mag());
        }
        P ref(P n) { // 2010-08-21: Reflect about vector "n"
                n = n.nor();
                return n*(n*(*this))*2 - *this;
        }
        void out() { printf("(%f,%f)\n", x, y); }
};

// ComputeIntersection
bool ssi(P a, P b, P c, P d, P &res) {
        P cd = d-c, ab = b-a;
        if (feq(cd^ab, 0))                      return 0;
        double t = ((a^ab) - (c^ab)) / (cd^ab);
        double s = ((c^cd) - (a^cd)) / (ab^cd);
        res = c + cd*t;
        return 1;
}

// Strictly ccw
bool Ccw(P a, P b, P c) { return fgt((b-a)^(c-a), 0); }

// Lie on segment
bool Btw(P a,P b,P c) { return feq((a-c).mag(), (b-a).mag()+(c-b).mag()); }

double Ang(P a, P b) {
        double res = atan2(a^b, a*b);
        if (flt(res, 0)) res += 2*PI;
        return res;
}

const int N = 20360;
P p[N], dir[N];
P a, b;
double the[N], spd[N], low[N];
int n, k;

int main() {
        a.eat();
        b.eat();
        scanf("%d", &n);
        FOR(i,0,n) {
                p[i].eat();
                scanf("%lf%lf", the+i, spd+i);
                dir[i]=P(cos(the[i]),sin(the[i]));
        }
        scanf("%d", &k);
        double len=(a-b).mag();
        FOR(i,0,n) {
                low[i]=0;
                if (fgt(spd[i],0))
                FOR(j,0,2036+1) {
                        P c=a+(b-a)*(j/2036.0);
                        double ang=Ang(c-p[i],dir[i]);
                        ang=min(ang, 2*PI-ang);
                        low[i]=max(low[i], len*(j/2036.0) / (ang/spd[i]));
                }
        }
        sort(low, low+n);
        double ans = k==n ? 0 : low[n-1-k];
        printf("%.20f\n", ans);
        return 0;
}

#include <cmath>
#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

const int MAXN = 10086;
const double EPS = 1e-6;
const double PI = atan2(0.0, -1.0);

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+(const Point& lhs, const Point& rhs) {
	return Point(lhs.x + rhs.x, lhs.y + rhs.y);
}

Point operator-(const Point& lhs, const Point& rhs) {
	return Point(lhs.x - rhs.x, lhs.y - rhs.y);
}

Point operator*(const double& lhs, const Point& rhs) {
	return Point(lhs * rhs.x, lhs * rhs.y);
}

double operator*(const Point& lhs, const Point& rhs) {
	return lhs.x * rhs.x + lhs.y * rhs.y;
}

double operator%(const Point& lhs, const Point& rhs) {
	return lhs.x * rhs.y - rhs.x * lhs.y;
}

double off(double a, double b) {
	a -= b;
	while (a < -PI) {
		a += 2 * PI;
	}
	while (a >= PI) {
		a -= 2 * PI;
	}
	return a;
}

double dis(double a, double b) {
	return fabs(off(a, b));
}

double gao(const Point& a, const Point& b, Point p, double q, double w) {
	double d = (b - a).abs();
	double h = fabs((p - a) % (b - a)) / d;
	if ((p - a) % (b - a) > 0) {
		p = p + 2 * h / d * Point(a.y - b.y, b.x - a.x);
		q = (b - a).arg() * 2 - q;
	}
	double q0 = (b - a).arg() - PI / 2;
	double qa = off((a - p).arg(), q0);
	double qb = off((b - p).arg(), q0);
	double qq = off(q, q0);

//	printf("%lf %lf %lf h=%lf (%lf, %lf)\n", qq, qa, qb, h, h * w, d / (dis(qq, qb) / w));

	double l = d / (dis(qq, qb) / w), r = 1e8;

	while (r - l > EPS) {
		double m = (l + r) / 2;
		double qc = h * w >= m ? qb : min(qb, max(qa, -acos(sqrt(h * w / m))));
//		printf("%lf %lf %lf %lf\n", m, qc, dis(qq, qc) / w, (tan(qc) - tan(qa)) * h / m);
		if (dis(qq, qc) / w <= (tan(qc) - tan(qa)) * h / m) {
			l = m;
		} else {
			r = m;
		}
	}
	return (l + r) / 2;
}

int main() {
	int n, m;
	Point a, b, p;
	double q, w;
	vector<double> v;

	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", &p.x, &p.y, &q, &w);
		v.push_back(gao(a, b, p, q, w));
	}

	v.push_back(0);
	sort(v.begin(), v.end());
	scanf("%d", &m);
	printf("%.10lf\n", v[n - m]);

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define M 100010
#define ep 1e-7

const double pi = acos(-1);

struct pnt {
	double x, y;
	pnt (double x = 0, double y = 0) : x(x), y(y) {}
	pnt operator +(pnt a) {return pnt(x + a.x, y + a.y);}
	pnt operator -(pnt a) {return pnt(x - a.x, y - a.y);}
	pnt operator /(double a) {return pnt(x / a, y / a);}
	pnt operator *(double a) {return pnt(x * a, y * a);}
	double operator ^ (pnt a) {return x * a.y - y * a.x;}
	double operator & (pnt a) {return x * a.x + y * a.y;}
	double dist() {return sqrt(x * x + y * y);}
	void input() {scanf("%lf %lf", &x, &y);}
	void print() {printf("%lf %lf\n", x, y);}
} pos[M], A, B;

double vec[M], a[M], w[M];
int n;

double angle(pnt b, pnt a, pnt c) {
	return acos((b - a & c - a) / (c - a).dist() / (b - a).dist());
}

double D;
int P;

double f(double x, int i, double d, double t, double dl, double v, double al) {
	return dl + v * x - d * sin(w[i] * x) / sin(al + w[i] * x);
}

bool check(double v) {
	int tot = 0;
	for (int i = 0; i < n; i++) {
		if (tot > P) return 0;
		pnt tp = pnt(cos(a[i]), sin(a[i]));
		double t = angle(pos[i] + tp, pos[i], B) / w[i];
		if (v * t < D) {tot++; continue;}
		t = angle(pos[i] + tp, pos[i], A) / w[i];
		if (v * t > D - ep) continue;
		double al = angle(pos[i], A, B);
		if (al > pi / 2 - ep) continue;
    double d = (pos[i] - A).dist();
    double T = (D - v * t) / v, dl = v * t;
    double st = 0, en = T;
    while (st < en - ep) {
			double x = (2 * st + en) / 3, y = (st + 2 * en) / 3;
			if (f(x, i, d, t, dl, v, al) < f(y, i, d, t, dl, v, al)) en = y;
			else st = x;
    }
    if (f(st, i, d, t, dl, v, al) < ep) tot++;
	}
	if (tot > P) return 0;
	return 1;
}

int main() {
	//freopen("F.in", "r", stdin);
	A.input(), B.input();
	D = (A - B).dist();
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		pos[i].input(); cin >> a[i] >> w[i];
	}
	scanf("%d", &P);
	double l = 0, r = 1e9;
	while (l < r - ep) {
		double mid = (l + r) / 2;
		if (check(mid)) r = mid;
		else l = mid;
	}
	printf("%.12lf\n", l);
}

#pragma comment(linker, "/STACK:60777216")

#include <algorithm>
#include <iostream>
#include <complex>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <ctime>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

#define sz(a)                   int(a.size())
#define all(a)                  (a).begin(), (a).end()
#define CL(a, b)                memset(a, b, sizeof a)
#define FOR(i, a, b)			for (int i(a); i < (b); ++i)
#define REP(i, n)               FOR(i, 0, n)
#define UN(a)                   sort(all(a)), (a).erase(unique(all(a)), (a).end())
#define pb                      push_back
#define SORT(a)                 sort(all(a))

typedef long long ll;
typedef vector <int> vi;
typedef pair <int, int> pii;

double xa,ya,xb,yb;
int n;
double x[11111],y[11111],a[11111],w[11111];
int k;

const double pi = acos(-1.);

double go(double a,double w){
	double v = 0;
	int num = 1000;
	REP(i,num+1){

		double x = xa + (xb-xa)*i/double(num);
		double y = ya + (yb-ya)*i/double(num);
		double q = atan2(y,x) - a;

		if(q>2*pi) q-=2*pi;
		while(q<0) q+=2*pi;
		if(q>2*pi-q) q = 2*pi - q;

		double T = (w < 1e-5 ? (i==0 ? 0 : 1e10) : q/w);

		v = max(v,hypot(x-xa,y-ya)/T);
	}

	return v;
}

int main() {
#ifdef LocalHost
	freopen("input.txt", "r", stdin);
#endif

	cin>>xa>>ya>>xb>>yb>>n;
	REP(i,n) scanf("%lf %lf %lf %lf",x+i,y+i,a+i,w+i);
	cin>>k;

	vector<double> v;
	REP(i,n){
		xa-=x[i],ya-=y[i],xb-=x[i],yb-=y[i];
		v.pb(go(a[i],w[i]));
		xa+=x[i],ya+=y[i],xb+=x[i],yb+=y[i];
	}
	SORT(v);
	reverse(v.begin(),v.end());
	if(k>=v.size()) puts("0.0000");
	else printf("%.4lf\n",v[k]);
	return 0;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

#define clr(x) memset((x), 0, sizeof(x))
#define pb push_back
#define mp make_pair
#define sz size()
#define For(i, st, en) for(int i=(st); i<=(int)(en); i++)
#define Ford(i, st, en) for(int i=(st); i>=(int)(en); i--)
#define forn(i, n) for(int i=0; i<(int)(n); i++)
#define ford(i, n) for(int i=(n)-1; i>=0; i--)
#define fori(it, x) for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)

template <class _T> inline _T sqr(const _T& x) { return x * x; }
template <class _T> inline string tostr(const _T& a) { ostringstream os(""); os << a; return os.str(); }

typedef double ld;

// Constants
const ld PI = 3.1415926535897932384626433832795;
const ld EPS = 1e-11;

// Types
typedef long long i64;
typedef set < int > SI;
typedef vector < int > VI;
typedef map < string, int > MSI;
typedef pair < int, int > PII;

struct tp{ld x,y;};

int n, k;
tp a[10240];
ld ang[10240];
ld w[10240];
tp p1, p2;
ld b0[10240];
ld tt;

inline ld dist(tp p1, tp p2)
{
	return sqrt(sqr(p1.x-p2.x) + sqr(p1.y-p2.y));
}

inline bool hit(ld s, int i)
{
	if (w[i] < EPS) return false;
	ld da = fabs(ang[i] - b0[i]);
	da = min(da, 2.0 * PI - da);
	ld t = da / w[i];
	if (t <= tt) return true;

	ld mi = 0.0;
	ld ma = 1.0;
	forn(tt, 141)
	{
		if (ma - mi < 1e-12) break;
		ld q1 = (mi * 2.0 + ma) / 3.0;
		ld q2 = (mi + 2.0 * ma) / 3.0;

		tp pp1, pp2;
		pp1.x = p1.x + (p2.x - p1.x) * q1;
		pp1.y = p1.y + (p2.y - p1.y) * q1;
		pp2.x = p1.x + (p2.x - p1.x) * q2;
		pp2.y = p1.y + (p2.y - p1.y) * q2;
		ld aa1 = atan2(pp1.y - a[i].y, pp1.x - a[i].x);
		ld aa2 = atan2(pp2.y - a[i].y, pp2.x - a[i].x);
		ld a1 = fabs(ang[i] - aa1);
		a1 = min(a1, 2.0 * PI - a1);
		ld a2 = fabs(ang[i] - aa2);
		a2 = min(a2, 2.0 * PI - a2);
		ld t1 = a1 / w[i];
		ld t2 = a2 / w[i];
		ld d1 = dist(p1, pp1);
		ld d2 = dist(p1, pp2);
		t1 -= d1 / s;
		t2 -= d2 / s;
		if (t1 <= 0.0) return true;
		if (t2 <= 0.0) return true;
		if (t1 < t2) ma = q2;
		else mi = q1;
	}
	return false;
}

bool check(ld s)
{
	int cnt = 0;
	tt = dist(p1, p2) / s;
	forn(i, n)
	{
		if (cnt + n - i <= k) return true;
		cnt += hit(s, i);
		if (cnt > k) return false;
	}
	return cnt <= k;
}

int main()
{
#ifdef ROOM_311
	time_t et_0 = clock();
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif
	cout << setiosflags(ios::fixed) << setprecision(10);

	int x, y;
	scanf("%d%d", &x, &y);
	p1.x = x;
	p1.y = y;
	scanf("%d%d", &x, &y);
	p2.x = x;
	p2.y = y;
	scanf("%d", &n);
	forn(i, n)
	{
		scanf("%d%d", &x, &y);
		a[i].x = x;
		a[i].y = y;
		double aa, ww;
		scanf("%lf%lf", &aa, &ww);
		if (aa > PI)
		{
			aa -= 2.0 * PI;
		}
		ang[i] = aa;
		w[i] = ww;
	}
	scanf("%d", &k);
	forn(i, n)
	{
		b0[i] = atan2(p2.y - a[i].y, p2.x - a[i].x);
	}

	ld mi = 1e-5;
	ld ma = 1e+7;

	while (ma - mi > 1e-5 && (ma - mi) / (ma + mi) > 5e-6)
	{
		ld q = (mi + ma) * 0.5;
		*(check(q) ? &ma : &mi) = q;
	}
	printf("%0.5lf\n", (double)mi);

#ifdef ROOM_311
	time_t et_1 = clock();
	fprintf(stderr, "Execution time = %0.0lf ms\n", (et_1 - et_0) * 1000.0 / CLOCKS_PER_SEC);
#endif
	return 0;
}

#pragma comment(linker, "/STACK:60777216")

#include <algorithm>
#include <iostream>
#include <complex>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <ctime>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

#define sz(a)                   int(a.size())
#define all(a)                  (a).begin(), (a).end()
#define CL(a, b)                memset(a, b, sizeof a)
#define FOR(i, a, b)			for (int i(a); i < (b); ++i)
#define REP(i, n)               FOR(i, 0, n)
#define UN(a)                   sort(all(a)), (a).erase(unique(all(a)), (a).end())
#define pb                      push_back
#define SORT(a)                 sort(all(a))

typedef long long ll;
typedef vector <int> vi;
typedef pair <int, int> pii;

double xa,ya,xb,yb;
int n;
double x[11111],y[11111],a[11111],w[11111];
int k;

const double pi = acos(-1.);

bool check(double v,double a,double w){
	int num = 1;
	REP(i,num+1){
		if(!i) continue;
		double x = xa + (xb-xa)*i/double(num);
		double y = ya + (yb-ya)*i/double(num);
		double q = atan2(y,x) - a;

		if(q>2*pi) q-=2*pi;
		if(q<0) q+=2*pi;
		if(q>2*pi-q) q = 2*pi - q;

		if(hypot(x-xa,y-ya)/v >=  (w < 1e-5 ? (i==0 ? 0 : 1e10) : q/w)) return 1;
	}

	return 0;
}

bool good(double s){
	int num = 0;
	REP(i,n){
		xa-=x[i],ya-=y[i],xb-=x[i],yb-=y[i];

		if(check(s,a[i],w[i]))
			num ++;

		xa+=x[i],ya+=y[i],xb+=x[i],yb+=y[i];
	}
	return num <= k;
}

int main() {
#ifdef LocalHost
	freopen("input.txt", "r", stdin);
#endif

	cin>>xa>>ya>>xb>>yb>>n;
	REP(i,n) scanf("%lf %lf %lf %lf",x+i,y+i,a+i,w+i);
	cin>>k;

	double a = 0, b = 1e6, best = 1e6;
	REP(i,40){
		double s = (a+b)/2;
		if(good(s))
			best = s, b = s;
		else a = s;
	}
	printf("%.4lf\n",best);

	return 0;
}

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long LL;
const double EPS = 1e-9, INF = 1e15, PI = acos(-1.0);
#define FOR(i,s,e) for(int i=s;i<e;i++)
#define flt(x,y) ((x)<(y)-EPS)
#define fgt(x,y) flt(y,x)
#define fle(x,y) !fgt(x,y)
#define fge(x,y) !flt(x,y)
#define feq(x,y) (fabs((x)-(y))<EPS)

#define chkMn(x,y) x=min(x,y)
#define chkMx(x,y) x=max(x,y)

double sq(double x) { return x*x; }

struct P{
        double x, y;
        P(){ }
        P(double x,double y):x(x),y(y){ }
        void eat(){ scanf("%lf%lf",&x,&y); }
        P operator+(const P &p)const{ return P(x+p.x, y+p.y); }
        P operator-(const P &p)const{ return P(x-p.x, y-p.y); }
        P operator*(double k){ return P(x*k, y*k); }
        double operator*(P p){ return x*p.x + y*p.y; }
        double operator^(P p){ return x*p.y - y*p.x; }
        double mag2() { return x*x+y*y; }
        double mag(){ return sqrt(mag2()); }
        bool operator<(const P &p)const {
                if (feq(x,p.x)) return flt(y,p.y);
                return flt(x,p.x);
        }
        bool operator==(const P &p)const {
                return feq(x,p.x) && feq(y,p.y);
        }
        P rot(){ return P(-y,x); }
        P rot(double the) {
                return P(x*cos(the)-y*sin(the), x*sin(the)+y*cos(the));
        }
        P nor(){
                if (feq(mag(),0))       return *this;
                return *this*(1./mag());
        }
        P ref(P n) { // 2010-08-21: Reflect about vector "n"
                n = n.nor();
                return n*(n*(*this))*2 - *this;
        }
        void out() { printf("(%f,%f)\n", x, y); }
};

// ComputeIntersection
bool ssi(P a, P b, P c, P d, P &res) {
        P cd = d-c, ab = b-a;
        if (feq(cd^ab, 0))                      return 0;
        double t = ((a^ab) - (c^ab)) / (cd^ab);
        double s = ((c^cd) - (a^cd)) / (ab^cd);
        res = c + cd*t;
        return 1;
}

// Strictly ccw
bool Ccw(P a, P b, P c) { return fgt((b-a)^(c-a), 0); }

// Lie on segment
bool Btw(P a,P b,P c) { return feq((a-c).mag(), (b-a).mag()+(c-b).mag()); }

double Ang(P a, P b) {
        double res = atan2(a^b, a*b);
        if (flt(res, 0)) res += 2*PI;
        return res;
//      return atan2(a^b, a*b);
}

P p[2036], dir[2036];
P a, b;
double the[2036], spd[2036];
int n, k;

int main() {
        a.eat();
        b.eat();
        scanf("%d", &n);
        FOR(i,0,n) {
                p[i].eat();
                scanf("%lf%lf", the+i, spd+i);
                dir[i]=P(cos(the[i])*1e5,sin(the[i])*1e5);
        }
        scanf("%d", &k);
        double lo = 0, hi = 1e20;
        FOR(iter,0,300) {
                double md = (lo+hi) * 0.5;
                int cur = 0;
                FOR(i,0,n) {
                        P c;
                        bool add = 0;
                        P arr[2]={a, b};
                        FOR(iter,0,2) {
                                FOR(r,0,2) {
                                        double we=(arr[r]-a).mag() / md;
                                        double ang=Ang(arr[r]-p[i],dir[i]);
                                        if (iter)       ang = 2*PI - ang;
                                        double enemy=ang / spd[i];
                                        while (flt(enemy, 0.1));
                                        add |= fle(enemy, we);
                                }
                        }
                        cur += add;
                        if (cur > k) break;
                }
                (cur > k ? lo : hi) = md;
        }
        printf("%.20f\n", lo);
        return 0;
}

#pragma comment(linker, "/STACK:60777216")

#include <algorithm>
#include <iostream>
#include <complex>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <ctime>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

#define sz(a)                   int(a.size())
#define all(a)                  (a).begin(), (a).end()
#define CL(a, b)                memset(a, b, sizeof a)
#define FOR(i, a, b)			for (int i(a); i < (b); ++i)
#define REP(i, n)               FOR(i, 0, n)
#define UN(a)                   sort(all(a)), (a).erase(unique(all(a)), (a).end())
#define pb                      push_back
#define SORT(a)                 sort(all(a))

typedef long long ll;
typedef vector <int> vi;
typedef pair <int, int> pii;

double xa,ya,xb,yb;
int n;
double x[11111],y[11111],a[11111],w[11111];
int k;

const double pi = acos(-1.);

double go(double a,double w){
	double v = 0;
	int num = 50;
	REP(i,num+1){

		double x = xa + (xb-xa)*i/double(num);
		double y = ya + (yb-ya)*i/double(num);
		double q = atan2(y,x) - a;

		if(q>2*pi) q-=2*pi;
		while(q<0) q+=2*pi;
		if(q>2*pi-q) q = 2*pi - q;

		double T = (w < 1e-5 ? (i==0 ? 0 : 1e10) : q/w);

		v = max(v,hypot(x-xa,y-ya)/T);
	}

	return v;
}

int main() {
#ifdef LocalHost
	freopen("input.txt", "r", stdin);
#endif

	cin>>xa>>ya>>xb>>yb>>n;
	REP(i,n) scanf("%lf %lf %lf %lf",x+i,y+i,a+i,w+i);
	cin>>k;

	vector<double> v;
	REP(i,n){
		xa-=x[i],ya-=y[i],xb-=x[i],yb-=y[i];
		v.pb(go(a[i],w[i]));
		xa+=x[i],ya+=y[i],xb+=x[i],yb+=y[i];
	}
	SORT(v);
	reverse(v.begin(),v.end());
	if(k>=v.size()) puts("0.0000");
	else printf("%.4lf\n",v[k]);
	return 0;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
using namespace std;
const double pi=acos(-1.00),eps=1e-9;
const int bound=1000;
struct point
{
    double x,y,w,a;
};
point st,en,tank[11111];
int n,k;
void norm(double &theta)
{
    while(theta<=-pi)
       theta+=2*pi;
    while(theta>pi)
       theta-=2*pi;
}
bool check(double v)
{
    int i,j,s,p,q,nk=0;
    double now_t,theta,T,dist=sqrt((st.x-en.x)*(st.x-en.x)+(st.y-en.y)*(st.y-en.y));
    double ltheta,rtheta,dtheta,low,high,mid,mt,vs,fs,bs,mx,my,fx,fy;
    int it;
    bool ft;
    T=dist/v;
    for(i=0;i<n;i++)
    {
    	double ds=((tank[i].x-st.x)*(en.y-st.y)-(tank[i].y-st.y)*(en.x-st.x));
    	if(fabs(ds)<eps)
    	{
	    	bool fk=false;
	    	if(tank[i].x<=max(st.x,en.x)+eps&&tank[i].x>=min(st.x,en.x)-eps&&tank[i].y<=max(st.y,en.y)+eps&&tank[i].y>=min(st.y,en.y)-eps)
	    	    fk=true;
	        if(fk)
	        {
	           nk++;
	           continue;
			}
		}
        theta=atan2(en.y-tank[i].y,en.x-tank[i].x);
        rtheta=theta;
        ltheta=atan2(st.y-tank[i].y,st.x-tank[i].x);
        if(ltheta>rtheta)
            dtheta=rtheta+2*pi-ltheta;
        else
            dtheta=rtheta-ltheta;
        ft=false;
        if(dtheta>pi)
            swap(ltheta,rtheta);
        if(ltheta<rtheta+eps)
        {
	       if(tank[i].a<rtheta+eps&&tank[i].a>ltheta-eps)
		  	    ft=true;
        }
        else
        {
        	if(tank[i].a<rtheta+eps||tank[i].a>ltheta-eps)
        	    ft=true;
        }
		if(tank[i].w==0)
		{
			if(ft)
			  nk++;
            continue;
		}
		else
        {
			while(ltheta<tank[i].a-eps)
			   ltheta+=2*pi;
	        while(rtheta<tank[i].a-eps)
               rtheta+=2*pi;
         	theta=atan2(en.y-st.y,en.x-st.x);
			low=(ltheta-tank[i].a)/tank[i].w;
			high=(rtheta-tank[i].a)/tank[i].w;
			assert((ltheta<rtheta&&!ft)||(ltheta>rtheta&&ft));
			if(ltheta>rtheta)
			     low=0;
			mt=low;
			fs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
			mt=high;
			bs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
			if((fs<1e-4&&bs>-1e-4)||(fs>-1e-4&&bs<1e-4))
			{
		    	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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
			    my=mt=(low+2*high)/3.;
			    fy=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
			if((fs>0&&fx<1e-4)||(fs<0&&fx>-1e-4))
			{
				nk++;
				continue;
			}
            if(ltheta>rtheta)
   	   	    {
    	   	   	low=(ltheta-tank[i].a)/tank[i].w;
    	   	   	high=(rtheta+2*pi-tank[i].a)/tank[i].w;
    	   	   	mt=low;
    	   	   	fs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
    	   	   	mt=high;
		    	bs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	     		if((fs<1e-4&&bs>-1e-4)||(fs>-1e-4&&bs<1e-4))
	    		{
	    	    	nk++;
	    			continue;
	    		}
	    		for(it=0;it<100;it++)
	    		{
	    			double mx,my,fx,fy;
	    			mx=mt=(2*low+high)/3.;
	    			fx=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	    		    my=mt=(low+2*high)/3.;
	    		    fy=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	    		if((fs>0&&fx<1e-4)||(fs<0&&fx>-1e-4))
	    		{
	    			nk++;
	    			continue;
	    		}
		     }
		}
        if(nk>k)
           return false;
    }
    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;
}

#include <iostream>
#include <complex>
#include <cmath>
#include <vector>
#include <algorithm>

using namespace std;

typedef complex<double> point;

double prodvec(point p1,point p2)
{
  return imag(conj(p1)*p2);
}

double prodesc(point p1,point p2)
{
  return real(conj(p1)*p2);
}

const int limite=20000;

double error=1e-7;

double computa(point p,point direccion,double w,double b)
{
  point pb(b,0);
  double tb=abs(arg((pb-p)/direccion))/w;
  double sol=b/tb;
  double x=real(p);
  double y=imag(p);
  if (x<=0) return sol;
  double inf=sol;
  double sup=1000000000;
  while (inf+error<sup) {
    double med=(inf+sup)/2.0;
    if (med*y/w<y*y) {
      sup=med;
    } else {
      point corte(x-sqrt(med*y/w-y*y),0.0);
      if (real(corte)<0 or real(corte)>b)
	sup=med;
      else {
	double t=abs(arg((corte-p)/direccion))/w;
	double tt=real(corte)/med;
	if (tt<t) sup=med;
	else inf=med;
      }
    }
  }
  return inf;
}

point pa,pb;
int n;
point p[100000];
point vp[100000];
double w[100000];
int k;

point leer()
{
  double x,y;
  cin>>x>>y;
  return point(x,y);
}

int main()
{
  cout.setf(ios::fixed);
  cout.precision(10);
  pa=leer();
  pb=leer();
  point divi=pb-pa;
  divi=divi/abs(divi);
  cin>>n;
  vector<double> v;
  for (int i=0;i<n;i++) {
    p[i]=leer();
    double a;
    cin>>a;
    vp[i]=polar(1.0,a);
    cin>>w[i];
    p[i]-=pa;
    p[i]=p[i]/divi;
    vp[i]=vp[i]/divi;
    if (imag(p[i])<0) {
      p[i]=conj(p[i]);
      vp[i]=conj(vp[i]);
    }
    v.push_back(computa(p[i],vp[i],w[i],abs(pb-pa)));
  }
  cin>>k;
  sort(v.begin(),v.end());
  if (k>=int(v.size())) cout<<0.0<<endl;
  else cout<<v[k]<<endl;
}

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>

#define y1 y3223789

using namespace std;

const int MAXN = 10000;

int n;
double x1, y1, 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 y1, double x2, double y2) {
    return x1 * y2 - x2 * y1;
}

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 y1, double x2, double y2, double x3, double y3, double x4, double y4) {
    double d = cross(x2 - x1, y2 - y1, x3 - x4, y3 - y4);
    double p = cross(x2 - x1, y2 - y1, x3 - x1, y3 - y1);
    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 = y1 * (1 - c1) + y2 * c1;
        double cx2 = x1 * (1 - c2) + x2 * c2;
        double cy2 = y1 * (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 - y1) * (y2 - y1)) / v;
    for (int i = 0; i < n; i++)
        if (check(i, v))
            ans++;
    return ans;
}

int main() {
    freopen("tanks.in", "r", stdin);
    freopen("tanks.out", "w", stdout);

    cin >> x1 >> y1 >> x2 >> y2;
    double dist = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
    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] - y1, x[i] - x2, y[i] - y2);
        t1[i] = get_time(i, x1, y1);
        t2[i] = get_time(i, x2, y2);
        p[i] = inter(x[i], y[i], x[i] + y2 - y1, y[i] + x1 - x2, x1, y1, 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;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

#define clr(x) memset((x), 0, sizeof(x))
#define pb push_back
#define mp make_pair
#define sz size()
#define For(i, st, en) for(int i=(st); i<=(int)(en); i++)
#define Ford(i, st, en) for(int i=(st); i>=(int)(en); i--)
#define forn(i, n) for(int i=0; i<(int)(n); i++)
#define ford(i, n) for(int i=(n)-1; i>=0; i--)
#define fori(it, x) for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)

template <class _T> inline _T sqr(const _T& x) { return x * x; }
template <class _T> inline string tostr(const _T& a) { ostringstream os(""); os << a; return os.str(); }

typedef double ld;

// Constants
const ld PI = 3.1415926535897932384626433832795;
const ld EPS = 1e-11;

// Types
typedef long long i64;
typedef set < int > SI;
typedef vector < int > VI;
typedef map < string, int > MSI;
typedef pair < int, int > PII;

struct tp{ld x,y;};

int n, k;
tp a[10240];
ld ang[10240];
ld w[10240];
tp p1, p2;
ld b0[10240];
ld tt;

inline ld dist(tp p1, tp p2)
{
	return sqrt(sqr(p1.x-p2.x) + sqr(p1.y-p2.y));
}

inline bool hit(ld s, int i)
{
	if (w[i] < EPS) return false;
	ld da = fabs(ang[i] - b0[i]);
	da = min(da, 2.0 * PI - da);
	ld t = da / w[i];
	if (t <= tt) return true;

	ld aa0 = atan2(p1.y - a[i].y, p1.x - a[i].x);
	ld a0 = fabs(ang[i] - aa0);
	a0 = min(a0, 2.0 * PI - a0);

	int z = 1;
	forn(j, z)
	{
		ld mi = j * 1.0 / z;
		ld ma = (j + 1.0) / z;
		forn(tt, 101)
		{
			if (ma - mi < 1e-11) break;
			ld q1 = (mi * 2.0 + ma) / 3.0;
			ld q2 = (mi + 2.0 * ma) / 3.0;

			tp pp1, pp2;
			pp1.x = p1.x + (p2.x - p1.x) * q1;
			pp1.y = p1.y + (p2.y - p1.y) * q1;
			pp2.x = p1.x + (p2.x - p1.x) * q2;
			pp2.y = p1.y + (p2.y - p1.y) * q2;
			ld aa1 = atan2(pp1.y - a[i].y, pp1.x - a[i].x);
			ld aa2 = atan2(pp2.y - a[i].y, pp2.x - a[i].x);
			ld a1 = fabs(a0 - aa1);
			a1 = min(a1, 2.0 * PI - a1);
			ld a2 = fabs(a0 - aa2);
			a2 = min(a2, 2.0 * PI - a2);
			ld t1 = (a1 + a0) / w[i];
			ld t2 = (a2 + a0) / w[i];
			ld d1 = dist(p1, pp1);
			ld d2 = dist(p1, pp2);
			t1 -= d1 / s;
			t2 -= d2 / s;
			if (t1 <= 0.0) return true;
			if (t2 <= 0.0) return true;
			if (t1 < t2) ma = q2;
			else mi = q1;
		}
	}
	return false;
}

bool check(ld s)
{
	int cnt = 0;
	tt = dist(p1, p2) / s;
	forn(i, n)
	{
		if (cnt + n - i <= k) return true;
		cnt += hit(s, i);
		if (cnt > k) return false;
	}
	return cnt <= k;
}

int main()
{
#ifdef ROOM_311
	time_t et_0 = clock();
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif
	cout << setiosflags(ios::fixed) << setprecision(10);

	int x, y;
	scanf("%d%d", &x, &y);
	p1.x = x;
	p1.y = y;
	scanf("%d%d", &x, &y);
	p2.x = x;
	p2.y = y;
	scanf("%d", &n);
	forn(i, n)
	{
		scanf("%d%d", &x, &y);
		a[i].x = x;
		a[i].y = y;
		double aa, ww;
		scanf("%lf%lf", &aa, &ww);
		if (aa > PI)
		{
			aa -= 2.0 * PI;
		}
		ang[i] = aa;
		w[i] = ww;
	}
	scanf("%d", &k);
	forn(i, n)
	{
		b0[i] = atan2(p2.y - a[i].y, p2.x - a[i].x);
	}

	ld mi = 3e-5;
	ld ma = 4e+6;

	while (ma - mi > 3e-5 && (ma - mi) / (ma + mi) > 3e-5)
	{
		ld q = (mi + ma) * 0.5;
		*(check(q) ? &ma : &mi) = q;
	}
	printf("%0.5lf\n", (double)mi);

#ifdef ROOM_311
	time_t et_1 = clock();
	fprintf(stderr, "Execution time = %0.0lf ms\n", (et_1 - et_0) * 1000.0 / CLOCKS_PER_SEC);
#endif
	return 0;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
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;
    double ltheta,rtheta,dtheta,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++)
    {
    	double ds=((tank[i].x-st.x)*(en.y-st.y)-(tank[i].y-st.y)*(en.x-st.x));
    	if(fabs(ds)<eps)
    	{
	    	bool fk=false;
	    	if(tank[i].x<=max(st.x,en.x)+eps&&tank[i].x>=min(st.x,en.x)-eps&&tank[i].y<=max(st.y,en.y)+eps&&tank[i].y>=min(st.y,en.y)-eps)
	    	    fk=true;
	        if(fk)
	        {
	           nk++;
	           continue;
			}
		}
        theta=atan2(en.y-tank[i].y,en.x-tank[i].x);
        rtheta=theta;
        ltheta=atan2(st.y-tank[i].y,st.x-tank[i].x);
        if(ltheta>rtheta)
            dtheta=rtheta+2*pi-ltheta;
        else
            dtheta=rtheta-ltheta;
        ft=false;
        if(dtheta>pi)
            swap(ltheta,rtheta);
        if(ltheta<rtheta+eps)
        {
	       if(tank[i].a<rtheta+eps&&tank[i].a>ltheta-eps)
		  	    ft=true;
        }
        else
        {
        	if(tank[i].a<rtheta+eps||tank[i].a>ltheta-eps)
        	    ft=true;
        }
		if(tank[i].w==0)
		{
			if(ft)
			  nk++;
            continue;
		}
		else
        {
        	assert(!ft);
			while(ltheta<tank[i].a-eps)
			   ltheta+=2*pi;
	        while(rtheta<tank[i].a-eps)
               rtheta+=2*pi;
       	  theta=atan2(en.y-st.y,en.x-st.x);
			low=(ltheta-tank[i].a)/tank[i].w;
			high=T;
			if(low>high)
			    return true;
     			mt=low;
    			fs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
    			mt=high;
    			bs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
    			if((fs<1e-4&&bs>-1e-4)||(fs>-1e-4&&bs<1e-4))
    			{
    		    	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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	    		    my=mt=(low+2*high)/3.;
	    		    fy=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
		    	if((fs>0&&fx<1e-4)||(fs<0&&fx>-1e-4))
		    	{
			    	nk++;
			    	continue;
		    	}
		}
        if(nk>k)
           return false;
    }
    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;
}

#include <map>
#include <set>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
#define li		long long
#define rep(i,to)	for(li i=0;i<((li)to);i++)
#define pb		push_back
#define sz(v)		((li)v.size())
double cal_ang(double x,double y){
	double res=acos(abs(x/hypot(x,y)));
	if(x<0 && y>0) return acos(-1)-res;
	if(x<0 && y<0) return acos(-1)+res;
	if(x>0 && y<0) return acos(-1)*2.0-res;
	return res;
}

int main(){
	double x0,x1,y0,y1,t0,t1,t2,t3;
	int n,k;
	vector<double> time;
	scanf("%lf%lf%lf%lf%d",&x0,&y0,&x1,&y1,&n);
	rep(i,n){
		scanf("%lf%lf%lf%lf",&t0,&t1,&t2,&t3);
		if(t3<1e-5) continue;
		x0-=t0; x1-=t0; y0-=t1; y1-=t1;
		double tmp=0;
		#define NUM 100
		rep(j,NUM+1){
			double x=x0+(x1-x0)*j/(double)NUM;
			double y=y0+(y1-y0)*j/(double)NUM;
			double ang=cal_ang(x,y);
			ang-=t2;
			if(ang<0) ang+=2.0*acos(-1);
			while(ang>acos(-1)*2.0) ang-=acos(-1)*2.0;
			ang=min(acos(-1)*2.0-ang,ang);
			tmp=max(tmp,hypot(x0-x,y0-y)/(ang/t3));
		}
		time.pb(tmp);
		x0+=t0; x1+=t0; y0+=t1; y1+=t1;
	}
	scanf("%d",&k);
	if(sz(time)<=k){
		printf("0.0000\n");
		return 0;
	}
	sort(time.begin(),time.end());
	printf("%.4lf\n",time[k]);
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
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)
       theta+=2*pi;
    while(theta>pi)
       theta-=2*pi;
}
bool check(double v)
{
    int i,j,s,p,q,nk=0;
    double now_t,theta,T,dist=sqrt((st.x-en.x)*(st.x-en.x)+(st.y-en.y)*(st.y-en.y));
    double ltheta,rtheta,dtheta;
    bool ft;
    T=dist/v;
//  printf("n")
    for(i=0;i<n;i++)
    {
    	double ds=((tank[i].x-st.x)*(en.y-st.y)-(tank[i].y-st.y)*(en.x-st.x));
    	if(fabs(ds)<eps)
    	{
	    	bool fk=false;
	    	if(tank[i].x<=max(st.x,en.x)+eps&&tank[i].x>=min(st.x,en.x)-eps&&tank[i].y<=max(st.y,en.y)+eps&&tank[i].y>=min(st.y,en.y)-eps)
	    	    fk=true;
	        if(fk)
	        {
	           nk++;
	           continue;
			}
		}
        theta=atan2(en.y-tank[i].y,en.x-tank[i].x);
        rtheta=theta;
        ltheta=atan2(st.y-tank[i].y,st.x-tank[i].x);
        if(ltheta>rtheta)
            dtheta=rtheta+2*pi-ltheta;
        else
            dtheta=rtheta-ltheta;
        ft=false;
        if(dtheta>pi)
            swap(ltheta,rtheta);
        if(ltheta<rtheta+eps)
        {
	       if(tank[i].a<rtheta+eps&&tank[i].a>ltheta-eps)
		  	    ft=true;
        }
        else
        {
        	if(tank[i].a<rtheta+eps||tank[i].a>ltheta-eps)
        	    ft=true;
        }
		if(tank[i].w==0)
		{
			if(ft)
			  nk++;
            continue;
		}
		else
        {
            if(theta<tank[i].a-1e-9)
               theta+=2*pi-tank[i].a;
            else
               theta-=tank[i].a;
            now_t=theta/tank[i].w;
            if(!ft&&now_t<T+eps)
            {
               nk++;
               continue;
			}
			if(ft&&now_t>T-eps)
			{
               nk++;
			   continue;
			}
		}
        if(nk>k)
           return false;
    }
    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;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

#define clr(x) memset((x), 0, sizeof(x))
#define pb push_back
#define mp make_pair
#define sz size()
#define For(i, st, en) for(int i=(st); i<=(int)(en); i++)
#define Ford(i, st, en) for(int i=(st); i>=(int)(en); i--)
#define forn(i, n) for(int i=0; i<(int)(n); i++)
#define ford(i, n) for(int i=(n)-1; i>=0; i--)
#define fori(it, x) for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)

template <class _T> inline _T sqr(const _T& x) { return x * x; }
template <class _T> inline string tostr(const _T& a) { ostringstream os(""); os << a; return os.str(); }

typedef double ld;

// Constants
const ld PI = 3.1415926535897932384626433832795;
const ld EPS = 1e-11;

// Types
typedef long long i64;
typedef set < int > SI;
typedef vector < int > VI;
typedef map < string, int > MSI;
typedef pair < int, int > PII;

struct tp{ld x,y;};

int n, k;
tp a[10240];
ld ang[10240];
ld w[10240];
tp p1, p2;
ld b0[10240];
ld tt;

inline ld dist(tp p1, tp p2)
{
	return sqrt(sqr(p1.x-p2.x) + sqr(p1.y-p2.y));
}

inline bool hit(ld s, int i)
{
	if (w[i] < EPS) return false;
	ld da = fabs(ang[i] - b0[i]);
	da = min(da, 2.0 * PI - da);
	ld t = da / w[i];
	if (t <= tt) return true;

	int z = 3;
	forn(j, 3)
	{
		ld mi = j * 1.0 / z;
		ld ma = (j + 1.0) / z;
		forn(tt, 101)
		{
			if (ma - mi < 1e-10) break;
			ld q1 = (mi * 2.0 + ma) / 3.0;
			ld q2 = (mi + 2.0 * ma) / 3.0;

			tp pp1, pp2;
			pp1.x = p1.x + (p2.x - p1.x) * q1;
			pp1.y = p1.y + (p2.y - p1.y) * q1;
			pp2.x = p1.x + (p2.x - p1.x) * q2;
			pp2.y = p1.y + (p2.y - p1.y) * q2;
			ld aa1 = atan2(pp1.y - a[i].y, pp1.x - a[i].x);
			ld aa2 = atan2(pp2.y - a[i].y, pp2.x - a[i].x);
			ld a1 = fabs(ang[i] - aa1);
			a1 = min(a1, 2.0 * PI - a1);
			ld a2 = fabs(ang[i] - aa2);
			a2 = min(a2, 2.0 * PI - a2);
			ld t1 = a1 / w[i];
			ld t2 = a2 / w[i];
			ld d1 = dist(p1, pp1);
			ld d2 = dist(p1, pp2);
			t1 -= d1 / s;
			t2 -= d2 / s;
			if (t1 <= 0.0) return true;
			if (t2 <= 0.0) return true;
			if (t1 < t2) ma = q2;
			else mi = q1;
		}
	}
	return false;
}

bool check(ld s)
{
	int cnt = 0;
	tt = dist(p1, p2) / s;
	forn(i, n)
	{
		if (cnt + n - i <= k) return true;
		cnt += hit(s, i);
		if (cnt > k) return false;
	}
	return cnt <= k;
}

int main()
{
#ifdef ROOM_311
	time_t et_0 = clock();
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif
	cout << setiosflags(ios::fixed) << setprecision(10);

	int x, y;
	scanf("%d%d", &x, &y);
	p1.x = x;
	p1.y = y;
	scanf("%d%d", &x, &y);
	p2.x = x;
	p2.y = y;
	scanf("%d", &n);
	forn(i, n)
	{
		scanf("%d%d", &x, &y);
		a[i].x = x;
		a[i].y = y;
		double aa, ww;
		scanf("%lf%lf", &aa, &ww);
		if (aa > PI)
		{
			aa -= 2.0 * PI;
		}
		ang[i] = aa;
		w[i] = ww;
	}
	scanf("%d", &k);
	forn(i, n)
	{
		b0[i] = atan2(p2.y - a[i].y, p2.x - a[i].x);
	}

	ld mi = 3e-5;
	ld ma = 1e+6;

	while (ma - mi > 3e-5 && (ma - mi) / (ma + mi) > 3e-5)
	{
		ld q = (mi + ma) * 0.5;
		*(check(q) ? &ma : &mi) = q;
	}
	printf("%0.5lf\n", (double)mi);

#ifdef ROOM_311
	time_t et_1 = clock();
	fprintf(stderr, "Execution time = %0.0lf ms\n", (et_1 - et_0) * 1000.0 / CLOCKS_PER_SEC);
#endif
	return 0;
}

#include <cmath>
#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

const int MAXN = 10086;
const double EPS = 1e-6;
const double PI = atan2(0.0, -1.0);

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+(const Point& lhs, const Point& rhs) {
	return Point(lhs.x + rhs.x, lhs.y + rhs.y);
}

Point operator-(const Point& lhs, const Point& rhs) {
	return Point(lhs.x - rhs.x, lhs.y - rhs.y);
}

Point operator*(const double& lhs, const Point& rhs) {
	return Point(lhs * rhs.x, lhs * rhs.y);
}

double operator*(const Point& lhs, const Point& rhs) {
	return lhs.x * rhs.x + lhs.y * rhs.y;
}

double operator%(const Point& lhs, const Point& rhs) {
	return lhs.x * rhs.y - rhs.x * lhs.y;
}

double off(double a, double b) {
	a -= b;
	while (a < -PI) {
		a += 2 * PI;
	}
	while (a >= PI) {
		a -= 2 * PI;
	}
	return a;
}

double dis(double a, double b) {
	return fabs(off(a, -b));
}

double gao(const Point& a, const Point& b, Point p, double q, double w) {
	double d = (b - a).abs();
	double h = fabs((p - a) % (b - a)) / d;
	if ((p - a) % (b - a) > 0) {
		p = p + 2 * h / d * Point(a.y - b.y, b.x - a.x);
		q = (b - a).arg() * 2 - q;
	}
	double q0 = (b - a).arg() - PI / 2;
	double qa = off((a - p).arg(), q0);
	double qb = off((b - p).arg(), q0);
	double qq = off(q, q0);

//	printf("%lf %lf %lf h=%lf (%lf, %lf)\n", qq, qa, qb, h, h * w, d / (dis(qq, qb) / w));

	double l = 0, r = 1e8;

	while (r - l > EPS) {
		double m = (l + r) / 2;
		double qc = h * w >= m ? qb : min(qb, max(qa, -acos(sqrt(h * w / m))));
	//	printf("%lf %lf %lf %lf\n", m, qc, dis(qq, qc) / w, (tan(qc) - tan(qa)) * h);
		if (dis(qq, qc) / w <= (tan(qc) - tan(qa)) * h / m) {
			l = m;
		} else {
			r = m;
		}
	}
	return (l + r) / 2;
}

int main() {
	int n, m;
	Point a, b, p;
	double q, w;
	vector<double> v;

	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", &p.x, &p.y, &q, &w);
		v.push_back(gao(a, b, p, q, w));
	}

	v.push_back(0);
	sort(v.begin(), v.end());
	scanf("%d", &m);
	printf("%.10lf\n", v[n - m]);

	return 0;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
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;
    double ltheta,rtheta,dtheta,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++)
    {
    	double ds=((tank[i].x-st.x)*(en.y-st.y)-(tank[i].y-st.y)*(en.x-st.x));
    	if(fabs(ds)<eps)
    	{
	    	bool fk=false;
	    	if(tank[i].x<=max(st.x,en.x)+eps&&tank[i].x>=min(st.x,en.x)-eps&&tank[i].y<=max(st.y,en.y)+eps&&tank[i].y>=min(st.y,en.y)-eps)
	    	    fk=true;
	        if(fk)
	        {
	           nk++;
	           continue;
			}
		}
        theta=atan2(en.y-tank[i].y,en.x-tank[i].x);
        rtheta=theta;
        ltheta=atan2(st.y-tank[i].y,st.x-tank[i].x);
        if(ltheta>rtheta)
            dtheta=rtheta+2*pi-ltheta;
        else
            dtheta=rtheta-ltheta;
        ft=false;
        if(dtheta>pi)
            swap(ltheta,rtheta);
        if(ltheta<rtheta+eps)
        {
	       if(tank[i].a<rtheta+eps&&tank[i].a>ltheta-eps)
		  	    ft=true;
        }
        else
        {
        	if(tank[i].a<rtheta+eps||tank[i].a>ltheta-eps)
        	    ft=true;
        }
		if(tank[i].w==0)
		{
			if(ft)
			  nk++;
            continue;
		}
		else
        {
			while(ltheta<tank[i].a-eps)
			   ltheta+=2*pi;
	        while(rtheta<tank[i].a-eps)
               rtheta+=2*pi;
         	theta=atan2(en.y-st.y,en.x-st.x);
			low=(ltheta-tank[i].a)/tank[i].w;
			high=min((rtheta-tank[i].a)/tank[i].w,T);
			if(ltheta>rtheta)
			     low=0;
            if(low<high+eps)
            {
     			mt=low;
    			fs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
    			mt=high;
    			bs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
    			if((fs<1e-4&&bs>-1e-4)||(fs>-1e-4&&bs<1e-4))
    			{
    		    	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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	    		    my=mt=(low+2*high)/3.;
	    		    fy=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	    		    if(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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
		    	if(fx<1e-4)
		    	{
			    	nk++;
			    	continue;
		    	}
            }
            if(ltheta>rtheta)
   	   	    {
    	   	   	low=(ltheta-tank[i].a)/tank[i].w;
    	   	   	high=min(T,(rtheta+2*pi-tank[i].a)/tank[i].w);
    	   	   	if(low<high+eps)
    	   	    {
    	   	     	mt=low;
    	   	     	fs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
    	   	   	    mt=high;
		    	    bs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	         		if((fs<1e-4&&bs>-1e-4)||(fs>-1e-4&&bs<1e-4))
	        		{
	        	    	nk++;
	        			continue;
	        		}
	        		for(it=0;it<100;it++)
	        		{
	        			double mx,my,fx,fy;
	        			mx=mt=(2*low+high)/3.;
	        			fx=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	        		    my=mt=(low+2*high)/3.;
	        		    fy=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	        			if(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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	        		if(fx<1e-4)
	        		{
	        			nk++;
	        			continue;
	        		}
    	   	    }
		     }
		}
        if(nk>k)
           return false;
    }
    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;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
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(ltheta<0)
           ltheta=-ltheta;
		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+tank[i].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+tank[i].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;
		    	}
		}
        if(nk>k)
           return false;
    }
    return nk<=k;
}
int main()
{
    int i,j,s,p,q;
    double low,high,mid;
   // st.x=rand()%100;
   // st.y=rand()%100;
   // en.x=rand()%100;
   // en.y=rand()%100;
	scanf("%lf%lf%lf%lf",&st.x,&st.y,&en.x,&en.y);
    //n=5;
	scanf("%d",&n);
    for(i=0;i<n;i++)
    {
    //	tank[i].x=rand();
    //	tank[i].y=rand();
    //	tank[i].a=rand();
    //	tank[i].w=rand()%100;
       scanf("%lf%lf%lf%lf",&tank[i].x,&tank[i].y,&tank[i].a,&tank[i].w);
       norm(tank[i].a);
    }
   // k=rand()%(n+1);
   // printf("%d\n",n);
//	printf("%.0f %.0f %.0f %.0f\n",st.x,st.y,en.x,en.y);
   // //for(i=0;i<n;i++)
    //   printf("%.0f %.0f %.0f %.0f\n",tank[i].x,tank[i].y,tank[i].a,tank[i].w);
  //  printf("%d\n",k);
    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;
}
/*
41 67 34 0
5
19169 15724 -1 58
26962 24464 -0 45
23281 16827 2 91
2995 11942 2 36
32391 14604 0 53
4
*/

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
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;
    double ltheta,rtheta,dtheta,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++)
    {
    	double ds=((tank[i].x-st.x)*(en.y-st.y)-(tank[i].y-st.y)*(en.x-st.x));
    	if(fabs(ds)<eps)
    	{
	    	bool fk=false;
	    	if(tank[i].x<=max(st.x,en.x)+eps&&tank[i].x>=min(st.x,en.x)-eps&&tank[i].y<=max(st.y,en.y)+eps&&tank[i].y>=min(st.y,en.y)-eps)
	    	    fk=true;
	        if(fk)
	        {
	           nk++;
	           continue;
			}
		}
        theta=atan2(en.y-tank[i].y,en.x-tank[i].x);
        rtheta=theta;
        ltheta=atan2(st.y-tank[i].y,st.x-tank[i].x);
        if(ltheta>rtheta)
            dtheta=rtheta+2*pi-ltheta;
        else
            dtheta=rtheta-ltheta;
        ft=false;
        if(dtheta>pi)
            swap(ltheta,rtheta);
        if(ltheta<rtheta+eps)
        {
	       if(tank[i].a<rtheta+eps&&tank[i].a>ltheta-eps)
		  	    ft=true;
        }
        else
        {
        	if(tank[i].a<rtheta+eps||tank[i].a>ltheta-eps)
        	    ft=true;
        }
		if(tank[i].w==0)
		{
			if(ft)
			  nk++;
            continue;
		}
		else
        {
			while(ltheta<tank[i].a-eps)
			   ltheta+=2*pi;
	        while(rtheta<tank[i].a-eps)
               rtheta+=2*pi;
         	theta=atan2(en.y-st.y,en.x-st.x);
			low=(ltheta-tank[i].a)/tank[i].w;
			high=min((rtheta-tank[i].a)/tank[i].w,T);
			if(ltheta>rtheta)
			     low=0;
            if(low<high+eps)
            {
     			mt=low;
    			fs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
    			mt=high;
    			bs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
    			if((fs<1e-2&&bs>-1e-2)||(fs>-1e-2&&bs<1e-2))
    			{
    		    	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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	    		    my=mt=(low+2*high)/3.;
	    		    fy=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
		    	if((fs>0&&fx<1e-2)||(fs<0&&fx>-1e-2))
		    	{
			    	nk++;
			    	continue;
		    	}
            }
            if(ltheta>rtheta)
   	   	    {
    	   	   	low=(ltheta-tank[i].a)/tank[i].w;
    	   	   	high=min(T,(rtheta+2*pi-tank[i].a)/tank[i].w);
    	   	   	if(low<high+eps)
    	   	    {
    	   	     	mt=low;
    	   	     	fs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
    	   	   	    mt=high;
		    	    bs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	         		if((fs<1e-2&&bs>-1e-2)||(fs>-1e-2&&bs<1e-2))
	        		{
	        	    	nk++;
	        			continue;
	        		}
	        		for(it=0;it<100;it++)
	        		{
	        			double mx,my,fx,fy;
	        			mx=mt=(2*low+high)/3.;
	        			fx=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	        		    my=mt=(low+2*high)/3.;
	        		    fy=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	        		if((fs>0&&fx<1e-2)||(fs<0&&fx>-1e-2))
	        		{
	        			nk++;
	        			continue;
	        		}
    	   	     }
		     }
		}
        if(nk>k)
           return false;
    }
    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;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
using namespace std;
const double pi=acos(-1.00),eps=1e-9;
const int bound=1000;
struct point
{
    double x,y,w,a;
};
point st,en,tank[11111];
int n,k;
void norm(double &theta)
{
    while(theta<=-pi)
       theta+=2*pi;
    while(theta>pi)
       theta-=2*pi;
}
bool check(double v)
{
    int i,j,s,p,q,nk=0;
    double now_t,theta,T,dist=sqrt((st.x-en.x)*(st.x-en.x)+(st.y-en.y)*(st.y-en.y));
    double ltheta,rtheta,dtheta,low,high,mid,mt,vs,fs,bs,mx,my,fx,fy;
    int it;
    bool ft;
    T=dist/v;
//  printf("n")
    for(i=0;i<n;i++)
    {
    	double ds=((tank[i].x-st.x)*(en.y-st.y)-(tank[i].y-st.y)*(en.x-st.x));
    	if(fabs(ds)<eps)
    	{
	    	bool fk=false;
	    	if(tank[i].x<=max(st.x,en.x)+eps&&tank[i].x>=min(st.x,en.x)-eps&&tank[i].y<=max(st.y,en.y)+eps&&tank[i].y>=min(st.y,en.y)-eps)
	    	    fk=true;
	        if(fk)
	        {
	           nk++;
	           continue;
			}
		}
        theta=atan2(en.y-tank[i].y,en.x-tank[i].x);
        rtheta=theta;
        ltheta=atan2(st.y-tank[i].y,st.x-tank[i].x);
        if(ltheta>rtheta)
            dtheta=rtheta+2*pi-ltheta;
        else
            dtheta=rtheta-ltheta;
        ft=false;
        if(dtheta>pi)
            swap(ltheta,rtheta);
        if(ltheta<rtheta+eps)
        {
	       if(tank[i].a<rtheta+eps&&tank[i].a>ltheta-eps)
		  	    ft=true;
        }
        else
        {
        	if(tank[i].a<rtheta+eps||tank[i].a>ltheta-eps)
        	    ft=true;
        }
		if(tank[i].w==0)
		{
			if(ft)
			  nk++;
            continue;
		}
		else
        {
            if(theta<tank[i].a-1e-9)
               theta+=2*pi-tank[i].a;
            else
               theta-=tank[i].a;
            now_t=theta/tank[i].w;
            if(!ft&&now_t<T+eps)
            {
               nk++;
               continue;
			}
			if(ft&&now_t>T-eps)
			{
               nk++;
			   continue;
			}
			while(ltheta<tank[i].a-eps)
			   ltheta+=2*pi;
	        while(rtheta<tank[i].a-eps)
               rtheta+=2*pi;
         	theta=atan2(en.y-st.y,en.x-st.x);
			low=(ltheta-tank[i].a)/tank[i].w;
			high=(rtheta-tank[i].a)/tank[i].w;
			if(ltheta>rtheta)
			     low=0;
			mt=low;
			fs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
			mt=high;
			bs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
			if((fs<1e-4&&bs>-1e-4)||(fs>-1e-4&&bs<1e-4))
			{
		    	nk++;
				continue;
			}
			for(it=0;it<50;it++)
			{
				mx=mt=(2*low+high)/3.;
				fx=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
			    my=mt=(low+2*high)/3.;
			    fy=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
			if((fs>0&&fx<1e-4)||(fs<0&&fx>-1e-4))
			{
				nk++;
				continue;
			}
            if(ltheta>rtheta)
   	   	    {
    	   	   	low=(ltheta-tank[i].a)/tank[i].w;
    	   	   	high=2*pi/tank[i].w;
    	   	   	mt=low;
    	   	   	fs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
    	   	   	mt=high;
		    	bs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	     		if((fs<1e-4&&bs>-1e-4)||(fs>-1e-4&&bs<1e-4))
	    		{
	    	    	nk++;
	    			continue;
	    		}
	    		for(it=0;it<50;it++)
	    		{
	    			double mx,my,fx,fy;
	    			mx=mt=(2*low+high)/3.;
	    			fx=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	    		    my=mt=(low+2*high)/3.;
	    		    fy=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	    		if((fs>0&&fx<1e-4)||(fs<0&&fx>-1e-4))
	    		{
	    			nk++;
	    			continue;
	    		}
		     }
		}
        if(nk>k)
           return false;
    }
    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;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
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;
    double ltheta,rtheta,dtheta,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++)
    {
    	double ds=((tank[i].x-st.x)*(en.y-st.y)-(tank[i].y-st.y)*(en.x-st.x));
    	if(fabs(ds)<eps)
    	{
	    	bool fk=false;
	    	if(tank[i].x<=max(st.x,en.x)+eps&&tank[i].x>=min(st.x,en.x)-eps&&tank[i].y<=max(st.y,en.y)+eps&&tank[i].y>=min(st.y,en.y)-eps)
	    	    fk=true;
	        if(fk)
	        {
	           nk++;
	           continue;
			}
		}
        theta=atan2(en.y-tank[i].y,en.x-tank[i].x);
        rtheta=theta;
        ltheta=atan2(st.y-tank[i].y,st.x-tank[i].x);
        if(ltheta>rtheta)
            dtheta=rtheta+2*pi-ltheta;
        else
            dtheta=rtheta-ltheta;
        ft=false;
        if(dtheta>pi)
            swap(ltheta,rtheta);
        if(ltheta<rtheta+eps)
        {
	       if(tank[i].a<rtheta+eps&&tank[i].a>ltheta-eps)
		  	    ft=true;
        }
        else
        {
        	if(tank[i].a<rtheta+eps||tank[i].a>ltheta-eps)
        	    ft=true;
        }
		if(tank[i].w==0)
		{
			if(ft)
			  nk++;
            continue;
		}
		else
        {
        	assert(!ft);
			while(ltheta<tank[i].a-eps)
			   ltheta+=2*pi;
	        while(rtheta<tank[i].a-eps)
               rtheta+=2*pi;
       	  theta=atan2(en.y-st.y,en.x-st.x);
			low=(ltheta-tank[i].a)/tank[i].w;
		    //high=(rtheta-tank[i].a)/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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
    			mt=high;
    			bs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
    			if((fs<1e-4&&bs>-1e-4)||(fs>-1e-4&&bs<1e-4))
    			{
    		    	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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	    		    my=mt=(low+2*high)/3.;
	    		    fy=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
		    	if((fs>0&&fx<1e-4)||(fs<0&&fx>-1e-4))
		    	{
			    	nk++;
			    	continue;
		    	}
		}
        if(nk>k)
           return false;
    }
    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;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

#define clr(x) memset((x), 0, sizeof(x))
#define pb push_back
#define mp make_pair
#define sz size()
#define For(i, st, en) for(int i=(st); i<=(int)(en); i++)
#define Ford(i, st, en) for(int i=(st); i>=(int)(en); i--)
#define forn(i, n) for(int i=0; i<(int)(n); i++)
#define ford(i, n) for(int i=(n)-1; i>=0; i--)
#define fori(it, x) for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)

template <class _T> inline _T sqr(const _T& x) { return x * x; }
template <class _T> inline string tostr(const _T& a) { ostringstream os(""); os << a; return os.str(); }

typedef double ld;

// Constants
const ld PI = 3.1415926535897932384626433832795;
const ld EPS = 1e-11;

// Types
typedef long long i64;
typedef set < int > SI;
typedef vector < int > VI;
typedef map < string, int > MSI;
typedef pair < int, int > PII;

struct tp{ld x,y;};

int n, k;
tp a[10240];
ld ang[10240];
ld w[10240];
tp p1, p2;
ld b0[10240];
ld tt;

inline ld dist(tp p1, tp p2)
{
	return sqrt(sqr(p1.x-p2.x) + sqr(p1.y-p2.y));
}

inline bool hit(ld s, int i)
{
	if (w[i] < EPS) return false;
	ld da = fabs(ang[i] - b0[i]);
	da = min(da, 2.0 * PI - da);
	ld t = da / w[i];
	if (t <= tt) return true;

	ld aa0 = atan2(p1.y - a[i].y, p1.x - a[i].x);
	ld a0 = fabs(ang[i] - aa0);
	a0 = min(a0, 2.0 * PI - a0);

	int z = 1;
	forn(j, z)
	{
		ld mi = j * 1.0 / z;
		ld ma = (j + 1.0) / z;
		forn(tt, 101)
		{
			if (ma - mi < 1e-11) break;
			ld q1 = (mi * 2.0 + ma) / 3.0;
			ld q2 = (mi + 2.0 * ma) / 3.0;

			tp pp1, pp2;
			pp1.x = p1.x + (p2.x - p1.x) * q1;
			pp1.y = p1.y + (p2.y - p1.y) * q1;
			pp2.x = p1.x + (p2.x - p1.x) * q2;
			pp2.y = p1.y + (p2.y - p1.y) * q2;
			ld aa1 = atan2(pp1.y - a[i].y, pp1.x - a[i].x);
			ld aa2 = atan2(pp2.y - a[i].y, pp2.x - a[i].x);
			ld a1 = fabs(aa0 - aa1);
			a1 = min(a1, 2.0 * PI - a1);
			ld a2 = fabs(aa0 - aa2);
			a2 = min(a2, 2.0 * PI - a2);
			ld t1 = (a1 + a0) / w[i];
			ld t2 = (a2 + a0) / w[i];
			ld d1 = dist(p1, pp1);
			ld d2 = dist(p1, pp2);
			t1 -= d1 / s;
			t2 -= d2 / s;
			if (t1 <= 0.0) return true;
			if (t2 <= 0.0) return true;
			if (t1 < t2) ma = q2;
			else mi = q1;
		}
	}
	return false;
}

bool check(ld s)
{
	int cnt = 0;
	tt = dist(p1, p2) / s;
	forn(i, n)
	{
		if (cnt + n - i <= k) return true;
		cnt += hit(s, i);
		if (cnt > k) return false;
	}
	return cnt <= k;
}

int main()
{
#ifdef ROOM_311
	time_t et_0 = clock();
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif
	cout << setiosflags(ios::fixed) << setprecision(10);

	int x, y;
	scanf("%d%d", &x, &y);
	p1.x = x;
	p1.y = y;
	scanf("%d%d", &x, &y);
	p2.x = x;
	p2.y = y;
	scanf("%d", &n);
	forn(i, n)
	{
		scanf("%d%d", &x, &y);
		a[i].x = x;
		a[i].y = y;
		double aa, ww;
		scanf("%lf%lf", &aa, &ww);
		if (aa > PI)
		{
			aa -= 2.0 * PI;
		}
		ang[i] = aa;
		w[i] = ww;
	}
	scanf("%d", &k);
	forn(i, n)
	{
		b0[i] = atan2(p2.y - a[i].y, p2.x - a[i].x);
	}

	ld mi = 3e-5;
	ld ma = 4e+6;

	while (ma - mi > 3e-5 && (ma - mi) / (ma + mi) > 3e-5)
	{
		ld q = (mi + ma) * 0.5;
		*(check(q) ? &ma : &mi) = q;
	}
	printf("%0.5lf\n", (double)mi);

#ifdef ROOM_311
	time_t et_1 = clock();
	fprintf(stderr, "Execution time = %0.0lf ms\n", (et_1 - et_0) * 1000.0 / CLOCKS_PER_SEC);
#endif
	return 0;
}

#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>

using namespace std;

#define REP(i,n) for((i)=0;(i)<(int)(n);(i)++)
#define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)

#define PI acos(-1.0)

struct point {double x,y;};

double dist(point &P, point &Q){
    double dx = P.x - Q.x, dy = P.y - Q.y;
    return sqrt(dx*dx + dy*dy);
}

double inprod(point &O, point &P, point &Q){
    return (P.x - O.x) * (Q.x - O.x) + (P.y - O.y) * (Q.y - O.y);
}

point foot(point &P, point &A, point &B){
    double t = inprod(A,B,P) / inprod(A,B,B);
    point ans = {A.x + (B.x - A.x) * t, A.y + (B.y - A.y) * t};
    return ans;
}

point rotate(point &P, double theta){
    double x = P.x * cos(theta) - P.y * sin(theta);
    double y = P.x * sin(theta) + P.y * cos(theta);
    point ans = {x,y};
    return ans;
}

double arg(point &P){
    double ans = atan2(P.y,P.x);
    if(ans < 0.0) ans += 2.0 * PI;
    return ans;
}

bool check(point &A, point &C, double v, double w){
    double t = dist(A,C) / v;
    double theta = arg(C); theta = min(theta, 2.0 * PI - theta);
    return (w * t > theta);
}

double func(point A, point B, point P, double a, double w){
    int iter;

    if(w < 1.0E-6) return 0.0;

    A.x -= P.x; A.y -= P.y; B.x -= P.x; B.y -= P.y;
    A = rotate(A,-a); B = rotate(B,-a);

    if(arg(A) > arg(B)) {A.y = -A.y; B.y = -B.y;}

    point O = {0.0,0.0};

    double low = 0.0, high = 1.0E+7, mid;
    REP(iter,100){
        mid = (high + low) / 2.0;

        if(check(A,B,mid,w)) {low = mid; continue;}

        point H = foot(O,A,B);
        double h = dist(O,H);

        if(h*w < mid){
            double t = sqrt(mid / (h*w) - 1.0);

            if(dist(H,A) > dist(H,O) * t){
                point C = {H.x + H.y * t, H.y - H.x * t};
                if(check(A,C,mid,w)) {low = mid; continue;}
            }

            if(dist(H,B) > dist(H,O) * t){
                point C = {H.x - H.y * t, H.y + H.x * t};
                if(check(A,C,mid,w)) {low = mid; continue;}
            }
        }

        high = mid;
    }

    return mid;
}

int main(void){
    int N,K,i;
    point A,B,P;
    double a,w;

    cin >> A.x >> A.y >> B.x >> B.y;
    cin >> N;

    vector <double> v;
    REP(i,N){
        cin >> P.x >> P.y >> a >> w;
        double tmp = func(A,B,P,a,w);
        v.push_back(tmp);
    }

    cin >> K;
    v.push_back(0.0);
    sort(v.begin(),v.end());
    double ans = v[N-K];

    printf("%.6f\n",ans);

    return 0;
}

#pragma comment(linker, "/STACK:60777216")

#include <algorithm>
#include <iostream>
#include <complex>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <ctime>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

#define sz(a)                   int(a.size())
#define all(a)                  (a).begin(), (a).end()
#define CL(a, b)                memset(a, b, sizeof a)
#define FOR(i, a, b)			for (int i(a); i < (b); ++i)
#define REP(i, n)               FOR(i, 0, n)
#define UN(a)                   sort(all(a)), (a).erase(unique(all(a)), (a).end())
#define pb                      push_back
#define SORT(a)                 sort(all(a))

typedef long long ll;
typedef vector <int> vi;
typedef pair <int, int> pii;

double xa,ya,xb,yb;
int n;
double x[11111],y[11111],a[11111],w[11111];
int k;

const double pi = acos(-1.);

bool check(double v,double a,double w){
	int num = 10;
	REP(i,num+1){
		//if(!i) continue;
		double x = xa + (xb-xa)*i/double(num);
		double y = ya + (yb-ya)*i/double(num);
		double q = atan2(y,x) - a;

		if(q>2*pi) q-=2*pi;
		while(q<0) q+=2*pi;
		if(q>2*pi-q) q = 2*pi - q;

		//if(q<0)
	//		cout<<q<<endl;
	//	while(q<0);

		if(hypot(x-xa,y-ya)/v >=  (w < 1e-5 ? (i==0 ? 0 : 1e10) : q/w)) return 1;
	}

	return 0;
}

bool good(double s){
	int num = 0;
	REP(i,n){
		xa-=x[i],ya-=y[i],xb-=x[i],yb-=y[i];

		if(check(s,a[i],w[i]))
			num ++;

		xa+=x[i],ya+=y[i],xb+=x[i],yb+=y[i];
	}
	return num <= k;
}

int main() {
#ifdef LocalHost
	freopen("input.txt", "r", stdin);
#endif

	cin>>xa>>ya>>xb>>yb>>n;
	REP(i,n) scanf("%lf %lf %lf %lf",x+i,y+i,a+i,w+i);
	cin>>k;

	double a = 0, b = 1e6, best = 1e6;
	REP(i,40){
		double s = (a+b)/2;
		if(good(s))
			best = s, b = s;
		else a = s;
	}
	printf("%.4lf\n",best);

	return 0;
}

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <cmath>
#include <set>
#include <map>
#include <cstdio>
#include <stdlib.h>
#include <stack>
#include <numeric>
#include <bitset>
typedef long long ll;
#define MAX 105
using namespace std;
int n,m,k;
#define INF 2147483647
#define MOD 1000000007
#define EPS 1e-8
#define G 9.8
#define PI 3.1415926535897
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 - EPS || (x < o.x + EPS && y < o.y - EPS); }
};
Point A,B;
map<double, int> js;
bool ck(double t) {
    int sk = 0;map<double, int>::iterator it=js.begin();
    for(; it!= js.end(); it++) {
        if (it->first < t-EPS) sk+=it->second;
        else break;
        if (sk>k) return false;
    }
    return sk<=k;
}
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) < EPS) continue;
        Point p = {x,y};
        double arg = (B-p).arg();
        if (arg < -EPS) arg += 2 * PI;
        if (abs(2*PI-a) < EPS) a=0.0;

        double jo = max(arg, a) - min(arg, a);
        jo = min(jo, 2*PI - jo);
        js[jo/w]++;
    }
    scanf("%d", &k);

    double tl=0, tr=js.rbegin()->first+10, t=0.0;

    while (abs(tl-tr) > EPS) {
        t = (tl+tr)/2;
        if (ck(t)) { tl=t;
        } else tr=t;
    }
    printf("%.4lf\n", t > js.rbegin()->first+1 ?  0 :(B-A).abs()/ t);
    return 0;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
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;
    double ltheta,rtheta,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++)
    {
    //	if(v==782)
    	  // printf("i=%d,nk=%d\n",i,nk);
    	double ds=((tank[i].x-st.x)*(en.y-st.y)-(tank[i].y-st.y)*(en.x-st.x));
    	if(fabs(ds)<eps)
    	{
	    	bool fk=false;
	    	if(tank[i].x<=max(st.x,en.x)+eps&&tank[i].x>=min(st.x,en.x)-eps&&tank[i].y<=max(st.y,en.y)+eps&&tank[i].y>=min(st.y,en.y)-eps)
	    	    fk=true;
	        if(fk)
	        {
	           nk++;
	           continue;
			}
		}
        theta=atan2(en.y-tank[i].y,en.x-tank[i].x);
        rtheta=theta;
        if(v==782)
        {
        	if(i==1)
        	   printf("theta=%.20f\n",theta);
        }
        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);
        if(ltheta<0)
           ltheta=-ltheta;
        if(rtheta<0)
           rtheta=-rtheta;
        if(ltheta>rtheta)
            swap(ltheta,rtheta);
		if(tank[i].w==0)
            continue;
		else
        {
			while(ltheta<tank[i].a-eps)
			   ltheta+=2*pi;
             ltheta-=tank[i].a;
             if(ltheta>pi)
               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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
    			mt=high;
    			bs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
    			if((fs<1e-4&&bs>-1e-4)||(fs>-1e-4&&bs<1e-4))
    			{
    		    	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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	    		    my=mt=(low+2*high)/3.;
	    		    fy=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
		    	if((fs>0&&fx<1e-4)||(fs<0&&fx>-1e-4))
		    	{
			    	nk++;
			    	continue;
		    	}
		}
        if(nk>k)
           return false;
    }
    return nk<=k;
}
int main()
{
    int i,j,s,p,q;
    double low,high,mid;
   // st.x=rand()%100;
   // st.y=rand()%100;
   // en.x=rand()%100;
   // en.y=rand()%100;
	scanf("%lf%lf%lf%lf",&st.x,&st.y,&en.x,&en.y);
    //n=5;
	scanf("%d",&n);
    for(i=0;i<n;i++)
    {
    //	tank[i].x=rand();
    //	tank[i].y=rand();
    //	tank[i].a=rand();
    //	tank[i].w=rand()%100;
       scanf("%lf%lf%lf%lf",&tank[i].x,&tank[i].y,&tank[i].a,&tank[i].w);
       norm(tank[i].a);
    }
   // k=rand()%(n+1);
   // printf("%d\n",n);
//	printf("%.0f %.0f %.0f %.0f\n",st.x,st.y,en.x,en.y);
   // //for(i=0;i<n;i++)
    //   printf("%.0f %.0f %.0f %.0f\n",tank[i].x,tank[i].y,tank[i].a,tank[i].w);
  //  printf("%d\n",k);
    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;
}
/*
41 67 34 0
5
19169 15724 -1 58
26962 24464 -0 45
23281 16827 2 91
2995 11942 2 36
32391 14604 0 53
4
*/

#include <algorithm>
#include <iostream>
#include <sstream>
#include <complex>
#include <numeric>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

#define all(a)			(a).begin(), (a).end()
#define sz(a)			int((a).size())
#define FOR(i, a, b)	for (int i(a); i < b; ++i)
#define REP(i, n)		FOR(i, 0, n)
#define UN(v)			sort(all(v)), (v).erase(unique((v).begin(), (v).end()), (v).end())
#define CL(a, b)		memset(a, b, sizeof a)
#define pb				push_back
#define X				first
#define Y				second

typedef long long ll;
typedef vector <int> vi;
typedef pair <int, int> pii;

const double pi2 = acos(-1.0) * 2;

double g(double x, double y, double a, double v) {
	double c = atan2(y, x) - a;
	if (c < 0) c += pi2;
	return min(c, pi2 - c);
}

double f(double x0, double y0, double x1, double y1, double a, double v) {
	double dx = x1 - x0, dy = y1 - y0, d = sqrt(dx * dx + dy * dy);
	double res = g(x1, y1, a, v) / d;
	for (double t = 1e-4; t < 1; t += 2e-4)
		res = min(res, g(x0 + dx * t, y0 + dy * t, a, v) / t);
	double L = 1e-4, R = 1, l, r, fl, fr;
	REP (k, 256) {
		l = (L * 2 + R) / 3;
		r = (L + R * 2) / 3;
		fl = g(x0 + dx * l, y0 + dy * l, a, v) / (l);
		fr = g(x0 + dx * r, y0 + dy * r, a, v) / (r);
		if (fl < fr) {
			res = min(res, fl);
			R = r;
		} else {
			res = min(res, fr);
			L = l;
		}
	}
	return d / res;
}

int main(){
	#ifdef LocalHost
	freopen("x.in", "r", stdin);
	freopen("x.out", "w", stdout);
	#endif
	double Ax, Ay, Bx, By;
	int n;
	cin >> Ax >> Ay >> Bx >> By >> n;
	vector <double> v;
	REP (i, n) {
		double x, y, a, w;
		scanf("%lf%lf%lf%lf", &x, &y, &a, &w);
		x = 5;
		y = -5;
		a = 4.71238;
		w = 1;
		v.pb(f(Ax - x, Ay - y, Bx - x, By - y, a, w));
	}
	sort(v.rbegin(), v.rend());
	v.pb(0);
	int k;
	cin >> k;
	printf("%.12lf\n", v[k]);
	return 0;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
using namespace std;
const double pi=acos(-1.00),eps=1e-9;
const int bound=100;
struct point
{
    double x,y,w,a;
};
point st,en,tank[11111];
int n,k;
void norm(double &theta)
{
    while(theta<=-pi)
       theta+=2*pi;
    while(theta>pi)
       theta-=2*pi;
}
bool check(double v)
{
    int i,j,s,p,q,nk=0;
    double now_t,theta,T,dist=sqrt((st.x-en.x)*(st.x-en.x)+(st.y-en.y)*(st.y-en.y));
    double ltheta,rtheta,dtheta,low,high,mid,mt,vs,fs,it;
    bool ft;
    T=dist/v;
//  printf("n")
    for(i=0;i<n;i++)
    {
    	double ds=((tank[i].x-st.x)*(en.y-st.y)-(tank[i].y-st.y)*(en.x-st.x));
    	if(fabs(ds)<eps)
    	{
	    	bool fk=false;
	    	if(tank[i].x<=max(st.x,en.x)+eps&&tank[i].x>=min(st.x,en.x)-eps&&tank[i].y<=max(st.y,en.y)+eps&&tank[i].y>=min(st.y,en.y)-eps)
	    	    fk=true;
	        if(fk)
	        {
	           nk++;
	           continue;
			}
		}
        theta=atan2(en.y-tank[i].y,en.x-tank[i].x);
        rtheta=theta;
        ltheta=atan2(st.y-tank[i].y,st.x-tank[i].x);
        if(ltheta>rtheta)
            dtheta=rtheta+2*pi-ltheta;
        else
            dtheta=rtheta-ltheta;
        ft=false;
        if(dtheta>pi)
            swap(ltheta,rtheta);
        if(ltheta<rtheta+eps)
        {
	       if(tank[i].a<rtheta+eps&&tank[i].a>ltheta-eps)
		  	    ft=true;
        }
        else
        {
        	if(tank[i].a<rtheta+eps||tank[i].a>ltheta-eps)
        	    ft=true;
        }
		if(tank[i].w==0)
		{
			if(ft)
			  nk++;
            continue;
		}
		else
        {
            if(theta<tank[i].a-1e-9)
               theta+=2*pi-tank[i].a;
            else
               theta-=tank[i].a;
            now_t=theta/tank[i].w;
            if(!ft&&now_t<T+eps)
            {
               nk++;
               continue;
			}
			if(ft&&now_t>T-eps)
			{
               nk++;
			   continue;
			}
			while(ltheta<tank[i].a-eps)
			   ltheta+=2*pi;
	        while(rtheta<tank[i].a-eps)
               rtheta+=2*pi;
         	theta=atan2(en.y-st.y,en.x-st.x);
				low=(ltheta-tank[i].a)/tank[i].w;
				high=(rtheta-tank[i].a)/tank[i].w;
				if(ltheta>rtheta)
				     low=0;
			    mt=low;
				fs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
				double dx=(high-low)/bound;
				for(it=low;it<=high;it+=dx)
				{
					mt=it;
					vs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
				    if((fs<eps&&vs>-eps)||(fs>-eps&&vs<eps))
				        break;
 			    }
 			    if(it<=high)
 			    {
    			 	nk++;
    			 	continue;
    	   	    }
    	   	    if(ltheta>rtheta)
    	   	    {
    	   	    	low=(ltheta-tank[i].a)/tank[i].w;
    	   	    	high=2*pi/tank[i].w;
    	   	    	mt=low;
    	   	     	fs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
    				theta=atan2(en.y-st.y,en.x-st.x);
     				double dx=(high-low)/bound;
	    			for(it=low;it<=high;it+=dx)
	    			{
	    				mt=it;
	    				vs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	    			    if((fs<eps&&vs>-eps)||(fs>-eps&&vs<eps))
	    			        break;
 	    		    }
 	     		    if(it<=high)
 		    	    {
    	    		 	nk++;
    	    		 	continue;
    	     	    }
    	   	    }
		}
        if(nk>k)
           return false;
    }
    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;
}

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long LL;
const double EPS = 1e-9, INF = 1e15, PI = acos(-1.0);
#define FOR(i,s,e) for(int i=s;i<e;i++)
#define flt(x,y) ((x)<(y)-EPS)
#define fgt(x,y) flt(y,x)
#define fle(x,y) !fgt(x,y)
#define fge(x,y) !flt(x,y)
#define feq(x,y) (fabs((x)-(y))<EPS)

#define chkMn(x,y) x=min(x,y)
#define chkMx(x,y) x=max(x,y)

double sq(double x) { return x*x; }

struct P{
        double x, y;
        P(){ }
        P(double x,double y):x(x),y(y){ }
        void eat(){ scanf("%lf%lf",&x,&y); }
        P operator+(const P &p)const{ return P(x+p.x, y+p.y); }
        P operator-(const P &p)const{ return P(x-p.x, y-p.y); }
        P operator*(double k){ return P(x*k, y*k); }
        double operator*(P p){ return x*p.x + y*p.y; }
        double operator^(P p){ return x*p.y - y*p.x; }
        double mag2() { return x*x+y*y; }
        double mag(){ return sqrt(mag2()); }
        bool operator<(const P &p)const {
                if (feq(x,p.x)) return flt(y,p.y);
                return flt(x,p.x);
        }
        bool operator==(const P &p)const {
                return feq(x,p.x) && feq(y,p.y);
        }
        P rot(){ return P(-y,x); }
        P rot(double the) {
                return P(x*cos(the)-y*sin(the), x*sin(the)+y*cos(the));
        }
        P nor(){
                if (feq(mag(),0))       return *this;
                return *this*(1./mag());
        }
        P ref(P n) { // 2010-08-21: Reflect about vector "n"
                n = n.nor();
                return n*(n*(*this))*2 - *this;
        }
        void out() { printf("(%f,%f)\n", x, y); }
};

// ComputeIntersection
bool ssi(P a, P b, P c, P d, P &res) {
        P cd = d-c, ab = b-a;
        if (feq(cd^ab, 0))                      return 0;
        double t = ((a^ab) - (c^ab)) / (cd^ab);
        double s = ((c^cd) - (a^cd)) / (ab^cd);
        res = c + cd*t;
        return 1;
}

// Strictly ccw
bool Ccw(P a, P b, P c) { return fgt((b-a)^(c-a), 0); }

// Lie on segment
bool Btw(P a,P b,P c) { return feq((a-c).mag(), (b-a).mag()+(c-b).mag()); }

double Ang(P a, P b) {
        double res = atan2(a^b, a*b);
        if (flt(res, 0)) res += 2*PI;
        return res;
}

P p[2036], dir[2036];
P a, b;
double the[2036], spd[2036];
double low[2036];
int n, k;

int main() {
        a.eat();
        b.eat();
        scanf("%d", &n);
        FOR(i,0,n) {
                p[i].eat();
                scanf("%lf%lf", the+i, spd+i);
                dir[i]=P(cos(the[i]),sin(the[i]));
        }
        scanf("%d", &k);
        double len=(a-b).mag();
        FOR(i,0,n) {
                low[i]=0;
                if (fgt(spd[i],0))
                FOR(j,0,2036) {
                        P c=a+(b-a)*(j/2036.0);
                        double ang=Ang(c-p[i],dir[i]);
                        ang=min(ang, 2*PI-ang);
                        low[i]=max(low[i], len*(j/2036.0) / (ang/spd[i]));
                }
        }
        sort(low, low+n);
        double ans = k==n ? 0 : low[n-1-k];
        printf("%.20f\n", ans);
        return 0;
}

#pragma comment(linker, "/STACK:60777216")

#include <algorithm>
#include <iostream>
#include <complex>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <ctime>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

#define sz(a)                   int(a.size())
#define all(a)                  (a).begin(), (a).end()
#define CL(a, b)                memset(a, b, sizeof a)
#define FOR(i, a, b)			for (int i(a); i < (b); ++i)
#define REP(i, n)               FOR(i, 0, n)
#define UN(a)                   sort(all(a)), (a).erase(unique(all(a)), (a).end())
#define pb                      push_back
#define SORT(a)                 sort(all(a))

typedef long long ll;
typedef vector <int> vi;
typedef pair <int, int> pii;

double xa,ya,xb,yb;
int n;
double x[11111],y[11111],a[11111],w[11111];
int k;

const double pi = acos(-1.);

double go(double a,double w){
	double v = 0;
	int num = 1000;
	REP(i,num+1){

		double x = xa + (xb-xa)*i/double(num);
		double y = ya + (yb-ya)*i/double(num);
		double q = atan2(y,x) - a;

		if(q>2*pi) q-=2*pi;
		while(q<0) q+=2*pi;
		if(q>2*pi-q) q = 2*pi - q;

		double T = (w < 1e-5 ? (i==0 ? 0 : 1e10) : q/w);

		v = max(v,hypot(x-xa,y-ya)/T);
	}

	return v;
}

int main() {
#ifdef LocalHost
	freopen("input.txt", "r", stdin);
#endif

	cin>>xa>>ya>>xb>>yb>>n;
	REP(i,n) scanf("%lf %lf %lf %lf",x+i,y+i,a+i,w+i);
	cin>>k;

	vector<double> v;
	REP(i,n){
		xa-=x[i],ya-=y[i],xb-=x[i],yb-=y[i];
		v.pb(go(a[i],w[i]));
		xa+=x[i],ya+=y[i],xb+=x[i],yb+=y[i];
	}
	SORT(v);
	if(k>=v.size()) puts("0.0000");
	else printf("%.4lf\n",v[k]);
	return 0;
}

#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;
#define x first
#define y second
typedef double dbl;

typedef pair <dbl, dbl> pnt;

pnt operator - (pnt a, pnt b) {
  return pnt (a.x - b.x, a.y - b.y);
}

pnt st, dir;
dbl _w, _s, _len;

inline dbl f(dbl t) {
  dbl x = st.x + dir.x * t,
      y = st.y + dir.y * t;
  dbl r = atan2 (y, x) - _s;
  while (r < 0) {
    r += 2 * M_PI;
  }
  while (r > 2 * M_PI) {
    r -= 2 * M_PI;
  }
//  fprintf (stderr,  "%lf : %lf (%lf %lf) | %lf\n", _len * t * _w, min(r, 2 * M_PI - r), x, y, r);
  return _len * t * _w / min(r, 2 * M_PI - r);
}

dbl get (pnt a, pnt b, dbl s, dbl w) {
  st = a;
  dir = b - a;
  _s = s;
  _w = w;
  _len = hypot (dir.x, dir.y);

  dbl res = 0;
  for (int i = 0; i <= 70; i++) {
    dbl t = f (i / 70.);
    if (t > res) {
      res = t;
    }
  }
  return res;
}

void read (pnt &p) {
  double x, y;
  scanf ("%lf%lf", &x, &y);
  p.x = x;
  p.y = y;
}

int main (void) {
  pnt a, b;
  read(a);
  read(b);

  int n;
  scanf ("%d", &n);

  vector <dbl> v(1, 0);
  for (int i = 0; i < n; i++) {
    pnt p;
    read(p);
    double s, w;
    scanf("%lf%lf", &s, &w);
    v.push_back(get(a - p, b - p, s, w));
  }

  sort (v.begin(), v.end());
  reverse (v.begin(), v.end());
  int k;
  scanf ("%d", &k);
  printf ("%.20lf\n", v[k]);

  return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define M 100010
#define ep 1e-9

const double pi = acos(-1);

struct pnt {
	double x, y;
	pnt (double x = 0, double y = 0) : x(x), y(y) {}
	pnt operator +(pnt a) {return pnt(x + a.x, y + a.y);}
	pnt operator -(pnt a) {return pnt(x - a.x, y - a.y);}
	pnt operator /(double a) {return pnt(x / a, y / a);}
	pnt operator *(double a) {return pnt(x * a, y * a);}
	double operator ^ (pnt a) {return x * a.y - y * a.x;}
	double operator & (pnt a) {return x * a.x + y * a.y;}
	double dist() {return sqrt(x * x + y * y);}
	void input() {scanf("%lf %lf", &x, &y);}
	void print() {printf("%lf %lf\n", x, y);}
} pos, A, B;

double vec[M];
double a, w;
int n;

double angle(pnt b, pnt a, pnt c) {
	return acos((b - a & c - a) / (c - a).dist() / (b - a).dist());
}

pnt rot(pnt a) {return pnt(-a.y, a.x);}

int main() {
	//freopen("F.in", "r", stdin);
	A.input(), B.input();
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		pos.input(), scanf("%lf %lf", &a, &w);
		pnt tp = pnt(cos(a), sin(a));
		double t = angle(pos + tp, pos, B) / w;
		double v = (A - B).dist() / t;
 		if (angle(pos, A, B) < pi / 2 - ep) {
			pnt pp = rot(B - A);
			if ((pos - A ^ B - A) < -ep) pp = pp * -1;
			t = angle(pos + tp, pos, pos + pp) / w;
			double d = (pos - A & B - A) / (B - A).dist();
			if (v < d / t) v = d / t;
		}

		vec[i] = v;
	}
	sort(vec, vec + n);
	int k;
	scanf("%d", &k);
	if (k == n) printf("%.12lf\n", 0.);
	else {
		printf("%.12lf\n", vec[n-k-1]);
	}
}

#pragma comment(linker, "/STACK:60777216")

#include <algorithm>
#include <iostream>
#include <complex>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <ctime>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

#define sz(a)                   int(a.size())
#define all(a)                  (a).begin(), (a).end()
#define CL(a, b)                memset(a, b, sizeof a)
#define FOR(i, a, b)			for (int i(a); i < (b); ++i)
#define REP(i, n)               FOR(i, 0, n)
#define UN(a)                   sort(all(a)), (a).erase(unique(all(a)), (a).end())
#define pb                      push_back
#define SORT(a)                 sort(all(a))

typedef long long ll;
typedef vector <int> vi;
typedef pair <int, int> pii;

double xa,ya,xb,yb;
int n;
double x[11111],y[11111],a[11111],w[11111];
int k;

const double pi = acos(-1.);

bool check(double v,double a,double w){
	int num = 100;
	REP(i,num+1){
		//if(!i) continue;
		double x = xa + (xb-xa)*i/double(num);
		double y = ya + (yb-ya)*i/double(num);
		double q = atan2(y,x) - a;

		if(q>2*pi) q-=2*pi;
		if(q<0) q+=2*pi;
		if(q>2*pi-q) q = 2*pi - q;

		if(hypot(x-xa,y-ya)/v >=  (w < 1e-5 ? (i==0 ? 0 : 1e10) : q/w)) return 1;
	}

	return 0;
}

bool good(double s){
	int num = 0;
	REP(i,n){
		xa-=x[i],ya-=y[i],xb-=x[i],yb-=y[i];

		if(check(s,a[i],w[i]))
			num ++;

		xa+=x[i],ya+=y[i],xb+=x[i],yb+=y[i];
	}
	return num <= k;
}

int main() {
#ifdef LocalHost
	freopen("input.txt", "r", stdin);
#endif

	cin>>xa>>ya>>xb>>yb>>n;
	REP(i,n) scanf("%lf %lf %lf %lf",x+i,y+i,a+i,w+i);
	cin>>k;

	double a = 0, b = 1e6, best = 1e6;
	REP(i,40){
		double s = (a+b)/2;
		if(good(s))
			best = s, b = s;
		else a = s;
	}
	printf("%.4lf\n",best);

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define M 100010
#define ep 1e-9

const double pi = acos(-1);

struct pnt {
	double x, y;
	pnt (double x = 0, double y = 0) : x(x), y(y) {}
	pnt operator +(pnt a) {return pnt(x + a.x, y + a.y);}
	pnt operator -(pnt a) {return pnt(x - a.x, y - a.y);}
	pnt operator /(double a) {return pnt(x / a, y / a);}
	pnt operator *(double a) {return pnt(x * a, y * a);}
	double operator ^ (pnt a) {return x * a.y - y * a.x;}
	double operator & (pnt a) {return x * a.x + y * a.y;}
	double dist() {return sqrt(x * x + y * y);}
	void input() {scanf("%lf %lf", &x, &y);}
	void print() {printf("%lf %lf\n", x, y);}
} pos, A, B;

double al[M];
double a, w;
int n;

double angle(pnt b, pnt a, pnt c) {
	return acos((b - a & c - a) / (c - a).dist() / (b - a).dist());
}

int main() {
	//freopen("F.in", "r", stdin);
	A.input(), B.input();
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		pos.input(), scanf("%lf %lf", &a, &w);
		pnt tp = pnt(cos(a), sin(a));
		double ang = angle(pos + tp, pos, B);
		double t1 = ang / w;
 		if (angle(pos, A, B) < pi / 2 - ep) {
			double t2 = fabs(pi / 2 - asin(((B - A) ^ tp) / (A - B).dist())) / w;
			double d = (pos  - A & B - A) / (B - A).dist();
			if (t2 / d < t1 / (A - B).dist()) t1 = t2;
		}
		al[i] = t1;
	}
	int k;
	scanf("%d", &k);
	if (k == n) printf("%.12lf\n", 0.);
	else {
		printf("%.12lf\n", (A - B).dist() / al[k] + ep);
	}
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

#define clr(x) memset((x), 0, sizeof(x))
#define pb push_back
#define mp make_pair
#define sz size()
#define For(i, st, en) for(int i=(st); i<=(int)(en); i++)
#define Ford(i, st, en) for(int i=(st); i>=(int)(en); i--)
#define forn(i, n) for(int i=0; i<(int)(n); i++)
#define ford(i, n) for(int i=(n)-1; i>=0; i--)
#define fori(it, x) for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)

template <class _T> inline _T sqr(const _T& x) { return x * x; }
template <class _T> inline string tostr(const _T& a) { ostringstream os(""); os << a; return os.str(); }

typedef double ld;

// Constants
const ld PI = 3.1415926535897932384626433832795;
const ld EPS = 1e-11;

// Types
typedef long long i64;
typedef set < int > SI;
typedef vector < int > VI;
typedef map < string, int > MSI;
typedef pair < int, int > PII;

struct tp{ld x,y;};

int n, k;
tp a[10240];
ld ang[10240];
ld w[10240];
tp p1, p2;
ld b0[10240];
ld tt;

inline ld dist(tp p1, tp p2)
{
	return sqrt(sqr(p1.x-p2.x) + sqr(p1.y-p2.y));
}

inline bool hit(ld s, int i)
{
	if (w[i] < EPS) return false;
	ld da = fabs(ang[i] - b0[i]);
	da = min(da, 2.0 * PI - da);
	ld t = da / w[i];
	if (t <= tt) return true;

	ld mi = 0.0;
	ld ma = 1.0;
	forn(tt, 101)
	{
		if (ma - mi < 1e-12) break;
		ld q1 = (mi * 2.0 + ma) / 3.0;
		ld q2 = (mi + 2.0 * ma) / 3.0;

		tp pp1, pp2;
		pp1.x = p1.x + (p2.x - p1.x) * q1;
		pp1.y = p1.y + (p2.y - p1.y) * q1;
		pp2.x = p1.x + (p2.x - p1.x) * q2;
		pp2.y = p1.y + (p2.y - p1.y) * q2;
		ld aa1 = atan2(pp1.y - a[i].y, pp1.x - a[i].x);
		ld aa2 = atan2(pp2.y - a[i].y, pp2.x - a[i].x);
		ld a1 = fabs(ang[i] - aa1);
		a1 = min(a1, 2.0 * PI - a1);
		ld a2 = fabs(ang[i] - aa2);
		a2 = min(a2, 2.0 * PI - a2);
		ld t1 = a1 / w[i];
		ld t2 = a2 / w[i];
		ld d1 = dist(p1, pp1);
		ld d2 = dist(p1, pp2);
		t1 -= d1 / s;
		t2 -= d2 / s;
		if (t1 <= 0.0) return true;
		if (t2 <= 0.0) return true;
		if (t1 < t2) ma = q2;
		else mi = q1;
	}
	return false;
}

bool check(ld s)
{
	int cnt = 0;
	tt = dist(p1, p2) / s;
	forn(i, n)
	{
		if (cnt + n - i <= k) return true;
		cnt += hit(s, i);
		if (cnt > k) return false;
	}
	return cnt <= k;
}

int main()
{
#ifdef ROOM_311
	time_t et_0 = clock();
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif
	cout << setiosflags(ios::fixed) << setprecision(10);

	int x, y;
	scanf("%d%d", &x, &y);
	p1.x = x;
	p1.y = y;
	scanf("%d%d", &x, &y);
	p2.x = x;
	p2.y = y;
	scanf("%d", &n);
	forn(i, n)
	{
		scanf("%d%d", &x, &y);
		a[i].x = x;
		a[i].y = y;
		double aa, ww;
		scanf("%lf%lf", &aa, &ww);
		if (aa > PI)
		{
			aa -= 2.0 * PI;
		}
		ang[i] = aa;
		w[i] = ww;
	}
	scanf("%d", &k);
	forn(i, n)
	{
		b0[i] = atan2(p2.y - a[i].y, p2.x - a[i].x);
	}

	ld mi = 1e-5;
	ld ma = 1e+15;

	while (ma - mi > 1e-5 && (ma - mi) / (ma + mi) > 5e-6)
	{
		ld q = (mi + ma) * 0.5;
		*(check(q) ? &ma : &mi) = q;
	}
	printf("%0.5lf\n", (double)mi);

#ifdef ROOM_311
	time_t et_1 = clock();
	fprintf(stderr, "Execution time = %0.0lf ms\n", (et_1 - et_0) * 1000.0 / CLOCKS_PER_SEC);
#endif
	return 0;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
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;
    double ltheta,rtheta,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);
        rtheta=theta;
        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(ltheta<0)
           ltheta=-ltheta;
        if(rtheta<0)
           rtheta=-rtheta;
        if(ltheta>rtheta)
            swap(ltheta,rtheta);
		if(tank[i].w==0)
            continue;
		else
        {
			while(ltheta<tank[i].a-eps)
			   ltheta+=2*pi;
             ltheta-=tank[i].a;
             if(ltheta>pi)
               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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
    			mt=high;
    			bs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	    		    my=mt=(low+2*high)/3.;
	    		    fy=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
		    	if((fs>0&&fx<eps)||(fs<0&&fx>-eps))
		    	{
			    	nk++;
			    	continue;
		    	}
		}
        if(nk>k)
           return false;
    }
    return nk<=k;
}
int main()
{
    int i,j,s,p,q;
    double low,high,mid;
   // st.x=rand()%100;
   // st.y=rand()%100;
   // en.x=rand()%100;
   // en.y=rand()%100;
	scanf("%lf%lf%lf%lf",&st.x,&st.y,&en.x,&en.y);
    //n=5;
	scanf("%d",&n);
    for(i=0;i<n;i++)
    {
    //	tank[i].x=rand();
    //	tank[i].y=rand();
    //	tank[i].a=rand();
    //	tank[i].w=rand()%100;
       scanf("%lf%lf%lf%lf",&tank[i].x,&tank[i].y,&tank[i].a,&tank[i].w);
       norm(tank[i].a);
    }
   // k=rand()%(n+1);
   // printf("%d\n",n);
//	printf("%.0f %.0f %.0f %.0f\n",st.x,st.y,en.x,en.y);
   // //for(i=0;i<n;i++)
    //   printf("%.0f %.0f %.0f %.0f\n",tank[i].x,tank[i].y,tank[i].a,tank[i].w);
  //  printf("%d\n",k);
    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;
}
/*
41 67 34 0
5
19169 15724 -1 58
26962 24464 -0 45
23281 16827 2 91
2995 11942 2 36
32391 14604 0 53
4
*/

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

#define clr(x) memset((x), 0, sizeof(x))
#define pb push_back
#define mp make_pair
#define sz size()
#define For(i, st, en) for(int i=(st); i<=(int)(en); i++)
#define Ford(i, st, en) for(int i=(st); i>=(int)(en); i--)
#define forn(i, n) for(int i=0; i<(int)(n); i++)
#define ford(i, n) for(int i=(n)-1; i>=0; i--)
#define fori(it, x) for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)

template <class _T> inline _T sqr(const _T& x) { return x * x; }
template <class _T> inline string tostr(const _T& a) { ostringstream os(""); os << a; return os.str(); }

typedef double ld;

// Constants
const ld PI = 3.1415926535897932384626433832795;
const ld EPS = 1e-11;

// Types
typedef long long i64;
typedef set < int > SI;
typedef vector < int > VI;
typedef map < string, int > MSI;
typedef pair < int, int > PII;

struct tp{ld x,y;};

int n, k;
tp a[10240];
ld ang[10240];
ld w[10240];
tp p1, p2;
ld b0[10240];
ld tt;

inline ld dist(tp p1, tp p2)
{
	return sqrt(sqr(p1.x-p2.x) + sqr(p1.y-p2.y));
}

inline bool hit(ld s, int i)
{
	if (w[i] < EPS) return false;
	ld da = fabs(ang[i] - b0[i]);
	da = min(da, 2.0 * PI - da);
	ld t = da / w[i];
	if (t <= tt) return true;

	int z = 3;
	forn(j, 3)
	{
		ld mi = j * 1.0 / z;
		ld ma = (j + 1.0) / z;
		forn(tt, 101)
		{
			if (ma - mi < 1e-13) break;
			ld q1 = (mi * 2.0 + ma) / 3.0;
			ld q2 = (mi + 2.0 * ma) / 3.0;

			tp pp1, pp2;
			pp1.x = p1.x + (p2.x - p1.x) * q1;
			pp1.y = p1.y + (p2.y - p1.y) * q1;
			pp2.x = p1.x + (p2.x - p1.x) * q2;
			pp2.y = p1.y + (p2.y - p1.y) * q2;
			ld aa1 = atan2(pp1.y - a[i].y, pp1.x - a[i].x);
			ld aa2 = atan2(pp2.y - a[i].y, pp2.x - a[i].x);
			ld a1 = fabs(ang[i] - aa1);
			a1 = min(a1, 2.0 * PI - a1);
			ld a2 = fabs(ang[i] - aa2);
			a2 = min(a2, 2.0 * PI - a2);
			ld t1 = a1 / w[i];
			ld t2 = a2 / w[i];
			ld d1 = dist(p1, pp1);
			ld d2 = dist(p1, pp2);
			t1 -= d1 / s;
			t2 -= d2 / s;
			if (t1 <= 0.0) return true;
			if (t2 <= 0.0) return true;
			if (t1 < t2) ma = q2;
			else mi = q1;
		}
	}
	return false;
}

bool check(ld s)
{
	int cnt = 0;
	tt = dist(p1, p2) / s;
	forn(i, n)
	{
		if (cnt + n - i <= k) return true;
		cnt += hit(s, i);
		if (cnt > k) return false;
	}
	return cnt <= k;
}

int main()
{
#ifdef ROOM_311
	time_t et_0 = clock();
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif
	cout << setiosflags(ios::fixed) << setprecision(10);

	int x, y;
	scanf("%d%d", &x, &y);
	p1.x = x;
	p1.y = y;
	scanf("%d%d", &x, &y);
	p2.x = x;
	p2.y = y;
	scanf("%d", &n);
	forn(i, n)
	{
		scanf("%d%d", &x, &y);
		a[i].x = x;
		a[i].y = y;
		double aa, ww;
		scanf("%lf%lf", &aa, &ww);
		if (aa > PI)
		{
			aa -= 2.0 * PI;
		}
		ang[i] = aa;
		w[i] = ww;
	}
	scanf("%d", &k);
	forn(i, n)
	{
		b0[i] = atan2(p2.y - a[i].y, p2.x - a[i].x);
	}

	ld mi = 3e-5;
	ld ma = 1e+6;

	while (ma - mi > 3e-5 && (ma - mi) / (ma + mi) > 3e-6)
	{
		ld q = (mi + ma) * 0.5;
		*(check(q) ? &ma : &mi) = q;
	}
	printf("%0.5lf\n", (double)mi);

#ifdef ROOM_311
	time_t et_1 = clock();
	fprintf(stderr, "Execution time = %0.0lf ms\n", (et_1 - et_0) * 1000.0 / CLOCKS_PER_SEC);
#endif
	return 0;
}

#pragma comment(linker, "/STACK:60777216")

#include <algorithm>
#include <iostream>
#include <complex>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <ctime>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

#define sz(a)                   int(a.size())
#define all(a)                  (a).begin(), (a).end()
#define CL(a, b)                memset(a, b, sizeof a)
#define FOR(i, a, b)			for (int i(a); i < (b); ++i)
#define REP(i, n)               FOR(i, 0, n)
#define UN(a)                   sort(all(a)), (a).erase(unique(all(a)), (a).end())
#define pb                      push_back
#define SORT(a)                 sort(all(a))

typedef long long ll;
typedef vector <int> vi;
typedef pair <int, int> pii;

double xa,ya,xb,yb;
int n;
double x[11111],y[11111],a[11111],w[11111];
int k;

const double pi = acos(-1.);

bool check(double v,double a,double w){
	int num = 100;
	REP(i,num+1){
		double x = xa + (xb-xa)*i/double(num);
		double y = ya + (yb-ya)*i/double(num);
		double q = atan2(y,x) - a;

		if(q>2*pi) q-=2*pi;
		if(q<0) q+=2*pi;
		if(q>2*pi-q) q = 2*pi - q;
		q/=w;

		if(hypot(x-xa,y-ya)/v >= q) return 1;
	}

	return 0;
}

bool good(double s){
	int num = 0;
	REP(i,n){
		xa-=x[i],ya-=y[i],xb-=x[i],yb-=y[i];

		if(check(s,a[i],w[i]))
			num ++;

		xa+=x[i],ya+=y[i],xb+=x[i],yb+=y[i];
	}
	return num <= k;
}

int main() {
#ifdef LocalHost
	freopen("input.txt", "r", stdin);
#endif

	cin>>xa>>ya>>xb>>yb>>n;
	REP(i,n) scanf("%lf %lf %lf %lf",x+i,y+i,a+i,w+i);
	cin>>k;

	double a = 0, b = 1e6, best = 1e6;
	REP(i,40){
		double s = (a+b)/2;
		if(good(s))
			best = s, b = s;
		else a = s;
	}
	printf("%.4lf\n",best);

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define M 100010
#define ep 1e-9

const double pi = acos(-1);

struct pnt {
	double x, y;
	pnt (double x = 0, double y = 0) : x(x), y(y) {}
	pnt operator +(pnt a) {return pnt(x + a.x, y + a.y);}
	pnt operator -(pnt a) {return pnt(x - a.x, y - a.y);}
	pnt operator /(double a) {return pnt(x / a, y / a);}
	pnt operator *(double a) {return pnt(x * a, y * a);}
	double operator ^ (pnt a) {return x * a.y - y * a.x;}
	double operator & (pnt a) {return x * a.x + y * a.y;}
	double dist() {return sqrt(x * x + y * y);}
	void input() {scanf("%lf %lf", &x, &y);}
	void print() {printf("%lf %lf\n", x, y);}
} pos, A, B;

double al[M];
double a, w;
int n;

double angle(pnt b, pnt a, pnt c) {
	return acos((b - a & c - a) / (c - a).dist() / (b - a).dist());
}

int main() {
	//freopen("F.in", "r", stdin);
	A.input(), B.input();
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		pos.input(), scanf("%lf %lf", &a, &w);
		pnt tp = pnt(cos(a), sin(a));
		double ang = angle(pos + tp, pos, B);
		double t1 = ang / w;
		/*
 		if (angle(pos, A, B) < pi / 2 - ep) {
			double t2 = fabs(pi / 2 - asin(((B - A) ^ tp) / (A - B).dist())) / w;
			double d = (pos  - A & B - A) / (B - A).dist();
			if (t2 / d < t1 / (A - B).dist()) t1 = t2;
		}
		*/
		al[i] = t1;
	}
	int k;
	scanf("%d", &k);
	if (k == n) printf("%.12lf\n", 0.);
	else {
		printf("%.12lf\n", (A - B).dist() / al[k] + ep);
	}
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
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)
       theta+=2*pi;
    while(theta>pi)
       theta-=2*pi;
}
bool check(double v)
{
    int i,j,s,p,q,nk=0;
    double now_t,theta,T,dist=sqrt((st.x-en.x)*(st.x-en.x)+(st.y-en.y)*(st.y-en.y));
    double ltheta,rtheta,dtheta;
    bool ft;
    T=dist/v;
//  printf("n")
    for(i=0;i<n;i++)
    {
    	double ds=((tank[i].x-st.x)*(en.y-st.y)-(tank[i].y-st.y)*(en.x-st.x));
    	if(fabs(ds)<eps)
    	{
	    	bool fk=false;
	    	if(tank[i].x<=max(st.x,en.x)+eps&&tank[i].x>=min(st.x,en.x)-eps&&tank[i].y<=max(st.y,en.y)+eps&&tank[i].y>=min(st.y,en.y)-eps)
	    	    fk=true;
	        if(fk)
	        {
	           nk++;
	           continue;
			}
		}
        theta=atan2(en.y-tank[i].y,en.x-tank[i].x);
        rtheta=theta;
        ltheta=atan2(st.y-tank[i].y,st.x-tank[i].x);
        if(ltheta>rtheta)
            dtheta=rtheta+2*pi-ltheta;
        else
            dtheta=rtheta-ltheta;
        ft=false;
        if(dtheta>pi)
            swap(ltheta,rtheta);
        if(ltheta<rtheta+eps)
        {
	       if(tank[i].a<rtheta+eps&&tank[i].a>ltheta-eps)
		  	    ft=true;
        }
        else
        {
        	if(tank[i].a<rtheta+eps||tank[i].a>ltheta-eps)
        	    ft=true;
        }
		if(tank[i].w==0)
		{
			if(ft)
			  nk++;
            continue;
		}
		else
        {
            if(theta<tank[i].a-1e-9)
               theta+=2*pi-tank[i].a;
            else
               theta-=tank[i].a;
            now_t=theta/tank[i].w;
            if(!ft&&now_t<T+eps)
               nk++;
            if(ft&&now_t>T-eps)
               nk++;
        }
        if(nk>k)
           return false;
    }
    return true;
}
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;
}

#include <algorithm>
#include <iostream>
#include <sstream>
#include <complex>
#include <numeric>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

#define all(a)			(a).begin(), (a).end()
#define sz(a)			int((a).size())
#define FOR(i, a, b)	for (int i(a); i < b; ++i)
#define REP(i, n)		FOR(i, 0, n)
#define UN(v)			sort(all(v)), (v).erase(unique((v).begin(), (v).end()), (v).end())
#define CL(a, b)		memset(a, b, sizeof a)
#define pb				push_back
#define X				first
#define Y				second

typedef long long ll;
typedef vector <int> vi;
typedef pair <int, int> pii;

const double pi2 = acos(-1.0) * 2;

double g(double x, double y, double a, double v) {
	double c = atan2(y, x) - a;
	if (c < 0) c += pi2;
	return min(c, pi2 - c);
}

double f(double x0, double y0, double x1, double y1, double a, double v) {
	double dx = x1 - x0, dy = y1 - y0, d = sqrt(dx * dx + dy * dy);
	double res = 1 / g(x1, y1, a, v);
	for (double t = 1e-4; t < 1; t += 2e-4)
		res = max(res, t / g(x0 + dx * t, y0 + dy * t, a, v));
	double L = 1e-4, R = 1, l, r, fl, fr;
	REP (k, 256) {
		l = (L * 2 + R) / 3;
		r = (L + R * 2) / 3;
		fl = l / g(x0 + dx * l, y0 + dy * l, a, v);
		fr = r / g(x0 + dx * r, y0 + dy * r, a, v);
		if (fl < fr) {
			res = max(res, fr);
			L = l;
		} else {
			res = max(res, fl);
			R = r;
		}
	}
	return d * res;
}

int main(){
	#ifdef LocalHost
	freopen("x.in", "r", stdin);
	freopen("x.out", "w", stdout);
	#endif
	double Ax, Ay, Bx, By;
	int n;
	cin >> Ax >> Ay >> Bx >> By >> n;
	vector <double> v;
	REP (i, n) {
		double x, y, a, w;
		scanf("%lf%lf%lf%lf", &x, &y, &a, &w);
		v.pb(f(Ax - x, Ay - y, Bx - x, By - y, a, w));
	}
	sort(v.rbegin(), v.rend());
	v.pb(0);
	int k;
	cin >> k;
	printf("%.12lf\n", v[k]);
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define M 100010
#define ep 1e-9

const double pi = acos(-1);

struct pnt {
	double x, y;
	pnt (double x = 0, double y = 0) : x(x), y(y) {}
	pnt operator +(pnt a) {return pnt(x + a.x, y + a.y);}
	pnt operator -(pnt a) {return pnt(x - a.x, y - a.y);}
	pnt operator /(double a) {return pnt(x / a, y / a);}
	pnt operator *(double a) {return pnt(x * a, y * a);}
	double operator ^ (pnt a) {return x * a.y - y * a.x;}
	double operator & (pnt a) {return x * a.x + y * a.y;}
	double dist() {return sqrt(x * x + y * y);}
	void input() {scanf("%lf %lf", &x, &y);}
	void print() {printf("%lf %lf\n", x, y);}
} pos, A, B;

double vec[M];
double a, w;
int n;

double angle(pnt b, pnt a, pnt c) {
	return acos((b - a & c - a) / (c - a).dist() / (b - a).dist());
}

pnt rot(pnt a) {return pnt(-a.y, a.x);}

int main() {
	//freopen("F.in", "r", stdin);
	A.input(), B.input();
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		pos.input(), scanf("%lf %lf", &a, &w);
		pnt tp = pnt(cos(a), sin(a));
		double t = angle(pos + tp, pos, B) / w, t1;
		double v = (A - B).dist() / t;
 		if (angle(pos, A, B) < pi / 2 - ep) {
			pnt pp = rot(B - A);
			if ((pos - A ^ B - A) < -ep) pp = pp * -1;
			t1 = angle(pos + tp, pos, pos + pp) / w;
			double d = (pos - A & B - A) / (B - A).dist();
			if (t1 < t && d < (B - A).dist() && v < d / t1) v = d / t1;
		}
		vec[i] = v;
	}
	sort(vec, vec + n);
	int k;
	scanf("%d", &k);
	if (k == n) printf("%.12lf\n", 0.);
	else {
		printf("%.12lf\n", vec[n-k-1]);
	}
}

#include <iostream>
#include <complex>
#include <cmath>
#include <vector>
#include <algorithm>

using namespace std;

typedef complex<double> point;

double prodvec(point p1,point p2)
{
  return imag(conj(p1)*p2);
}

double prodesc(point p1,point p2)
{
  return real(conj(p1)*p2);
}

const int limite=20000;

double error=1e-7;

double computa(point p,point direccion,double w,double b)
{
  point pb(b,0);
  double tb=abs(arg((pb-p)/direccion))/w;
  double sol=b/tb;
  double x=real(p);
  double y=imag(p);
  if (x<=0) return sol;
  double inf=sol;
  double sup=1000000000;
  while (inf+error<sup) {
    double med=(inf+sup)/2.0;
    if (med*y/w<y*y) {
      sup=med;
    } else {
      point corte(x-sqrt(med*y/w-y*y),0.0);
      if (real(corte)<0 or real(corte)>b)
	sup=med;
      else {
	double t=abs(arg((corte-p)/direccion))/w;
	double tt=real(corte)/med;
	if (tt<t) sup=med;
	else inf=med;
      }
    }
  }
  return inf;
}

point pa,pb;
int n;
point p[100000];
point vp[100000];
double w[100000];
int k;

point leer()
{
  double x,y;
  cin>>x>>y;
  return point(x,y);
}

int main()
{
  cout.setf(ios::fixed);
  cout.precision(10);
  pa=leer();
  pb=leer();
  point divi=pb-pa;
  divi=divi/abs(divi);
  cin>>n;
  vector<double> v;
  for (int i=0;i<n;i++) {
    p[i]=leer();
    double a;
    cin>>a;
    vp[i]=polar(1.0,a);
    cin>>w[i];
    p[i]-=pa;
    p[i]=p[i]/divi;
    vp[i]=vp[i]/divi;
    if (imag(p[i])<0) {
      p[i]=conj(p[i]);
      vp[i]=conj(vp[i]);
    }
    v.push_back(computa(p[i],vp[i],w[i],abs(pb-pa)));
  }
  cin>>k;
  sort(v.begin(),v.end());
  if (k>=int(v.size())) cout<<0.0<<endl;
  else cout<<v[k]<<endl;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

#define clr(x) memset((x), 0, sizeof(x))
#define pb push_back
#define mp make_pair
#define sz size()
#define For(i, st, en) for(int i=(st); i<=(int)(en); i++)
#define Ford(i, st, en) for(int i=(st); i>=(int)(en); i--)
#define forn(i, n) for(int i=0; i<(int)(n); i++)
#define ford(i, n) for(int i=(n)-1; i>=0; i--)
#define fori(it, x) for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)

template <class _T> inline _T sqr(const _T& x) { return x * x; }
template <class _T> inline string tostr(const _T& a) { ostringstream os(""); os << a; return os.str(); }

typedef double ld;

// Constants
const ld PI = 3.1415926535897932384626433832795;
const ld EPS = 1e-11;

// Types
typedef long long i64;
typedef set < int > SI;
typedef vector < int > VI;
typedef map < string, int > MSI;
typedef pair < int, int > PII;

struct tp{ld x,y;};

int n, k;
tp a[10240];
ld ang[10240];
ld w[10240];
tp p1, p2;
ld b0[10240];
ld tt;

inline ld dist(tp p1, tp p2)
{
	return sqrt(sqr(p1.x-p2.x) + sqr(p1.y-p2.y));
}

inline bool hit(ld s, int i)
{
	if (w[i] < EPS) return false;
	ld da = fabs(ang[i] - b0[i]);
	da = min(da, 2.0 * PI - da);
	ld t = da / w[i];
	if (t <= tt) return true;

	int z = 1;
	forn(j, z)
	{
		ld mi = j * 1.0 / z;
		ld ma = (j + 1.0) / z;
		forn(tt, 101)
		{
			if (ma - mi < 1e-13) break;
			ld q1 = (mi * 2.0 + ma) / 3.0;
			ld q2 = (mi + 2.0 * ma) / 3.0;

			tp pp1, pp2;
			pp1.x = p1.x + (p2.x - p1.x) * q1;
			pp1.y = p1.y + (p2.y - p1.y) * q1;
			pp2.x = p1.x + (p2.x - p1.x) * q2;
			pp2.y = p1.y + (p2.y - p1.y) * q2;
			ld aa1 = atan2(pp1.y - a[i].y, pp1.x - a[i].x);
			ld aa2 = atan2(pp2.y - a[i].y, pp2.x - a[i].x);
			ld a1 = fabs(ang[i] - aa1);
			a1 = min(a1, 2.0 * PI - a1);
			ld a2 = fabs(ang[i] - aa2);
			a2 = min(a2, 2.0 * PI - a2);
			ld t1 = a1 / w[i];
			ld t2 = a2 / w[i];
			ld d1 = dist(p1, pp1);
			ld d2 = dist(p1, pp2);
			t1 -= d1 / s;
			t2 -= d2 / s;
			if (t1 <= 0.0) return true;
			if (t2 <= 0.0) return true;
			if (t1 < t2) ma = q2;
			else mi = q1;
		}
	}
	return false;
}

bool check(ld s)
{
	int cnt = 0;
	tt = dist(p1, p2) / s;
	forn(i, n)
	{
		if (cnt + n - i <= k) return true;
		cnt += hit(s, i);
		if (cnt > k) return false;
	}
	return cnt <= k;
}

int main()
{
#ifdef ROOM_311
	time_t et_0 = clock();
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif
	cout << setiosflags(ios::fixed) << setprecision(10);

	int x, y;
	scanf("%d%d", &x, &y);
	p1.x = x;
	p1.y = y;
	scanf("%d%d", &x, &y);
	p2.x = x;
	p2.y = y;
	scanf("%d", &n);
	forn(i, n)
	{
		scanf("%d%d", &x, &y);
		a[i].x = x;
		a[i].y = y;
		double aa, ww;
		scanf("%lf%lf", &aa, &ww);
		if (aa > PI)
		{
			aa -= 2.0 * PI;
		}
		ang[i] = aa;
		w[i] = ww;
	}
	scanf("%d", &k);
	forn(i, n)
	{
		b0[i] = atan2(p2.y - a[i].y, p2.x - a[i].x);
	}

	ld mi = 3e-5;
	ld ma = 1e+7;

	while (ma - mi > 3e-5 && (ma - mi) / (ma + mi) > 3e-6)
	{
		ld q = (mi + ma) * 0.5;
		*(check(q) ? &ma : &mi) = q;
	}
	printf("%0.5lf\n", (double)mi);

#ifdef ROOM_311
	time_t et_1 = clock();
	fprintf(stderr, "Execution time = %0.0lf ms\n", (et_1 - et_0) * 1000.0 / CLOCKS_PER_SEC);
#endif
	return 0;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

#define clr(x) memset((x), 0, sizeof(x))
#define pb push_back
#define mp make_pair
#define sz size()
#define For(i, st, en) for(int i=(st); i<=(int)(en); i++)
#define Ford(i, st, en) for(int i=(st); i>=(int)(en); i--)
#define forn(i, n) for(int i=0; i<(int)(n); i++)
#define ford(i, n) for(int i=(n)-1; i>=0; i--)
#define fori(it, x) for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)

template <class _T> inline _T sqr(const _T& x) { return x * x; }
template <class _T> inline string tostr(const _T& a) { ostringstream os(""); os << a; return os.str(); }

typedef double ld;

// Constants
const ld PI = 3.1415926535897932384626433832795;
const ld EPS = 1e-11;

// Types
typedef long long i64;
typedef set < int > SI;
typedef vector < int > VI;
typedef map < string, int > MSI;
typedef pair < int, int > PII;

struct tp{ld x,y;};

int n, k;
tp a[10240];
ld ang[10240];
ld w[10240];
tp p1, p2;
ld b0[10240];
ld tt;

inline ld dist(tp p1, tp p2)
{
	return sqrt(sqr(p1.x-p2.x) + sqr(p1.y-p2.y));
}

inline bool hit(ld s, int i)
{
	if (w[i] < EPS) return false;
	ld da = fabs(ang[i] - b0[i]);
	da = min(da, 2.0 * PI - da);
	ld t = da / w[i];
	if (t <= tt) return true;

	ld mi = 0.0;
	ld ma = 1.0;
	forn(tt, 101)
	{
		if (ma - mi < 1e-11) break;
		ld q1 = (mi * 2.0 + ma) / 3.0;
		ld q2 = (mi + 2.0 * ma) / 3.0;

		tp pp1, pp2;
		pp1.x = p1.x + (p2.x - p1.x) * q1;
		pp1.y = p1.y + (p2.y - p1.y) * q1;
		pp2.x = p1.x + (p2.x - p1.x) * q2;
		pp2.y = p1.y + (p2.y - p1.y) * q2;
		ld aa1 = atan2(pp1.y - a[i].y, pp1.x - a[i].x);
		ld aa2 = atan2(pp2.y - a[i].y, pp2.x - a[i].x);
		ld a1 = fabs(ang[i] - aa1);
		a1 = min(a1, 2.0 * PI - a1);
		ld a2 = fabs(ang[i] - aa2);
		a2 = min(a2, 2.0 * PI - a2);
		ld t1 = a1 / w[i];
		ld t2 = a2 / w[i];
		ld d1 = dist(p1, pp1);
		ld d2 = dist(p1, pp2);
		t1 -= d1 / s;
		t2 -= d2 / s;
		if (t1 <= 0.0) return true;
		if (t2 <= 0.0) return true;
		if (t1 < t2) ma = q2;
		else mi = q1;
	}
	return false;
}

bool check(ld s)
{
	int cnt = 0;
	tt = dist(p1, p2) / s;
	forn(i, n)
	{
		if (cnt + n - i <= k) return true;
		cnt += hit(s, i);
		if (cnt > k) return false;
	}
	return cnt <= k;
}

int main()
{
#ifdef ROOM_311
	time_t et_0 = clock();
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif
	cout << setiosflags(ios::fixed) << setprecision(10);

	int x, y;
	scanf("%d%d", &x, &y);
	p1.x = x;
	p1.y = y;
	scanf("%d%d", &x, &y);
	p2.x = x;
	p2.y = y;
	scanf("%d", &n);
	forn(i, n)
	{
		scanf("%d%d", &x, &y);
		a[i].x = x;
		a[i].y = y;
		double aa, ww;
		scanf("%lf%lf", &aa, &ww);
		if (aa > PI)
		{
			aa -= 2.0 * PI;
		}
		ang[i] = aa;
		w[i] = ww;
	}
	scanf("%d", &k);
	forn(i, n)
	{
		b0[i] = atan2(p2.y - a[i].y, p2.x - a[i].x);
	}

	ld mi = 1e-5;
	ld ma = 1e+10;

	while (ma - mi > 1e-5 && (ma - mi) / (ma + mi) > 1e-5)
	{
		ld q = (mi + ma) * 0.5;
		*(check(q) ? &ma : &mi) = q;
	}
	printf("%0.5lf\n", (double)mi);

#ifdef ROOM_311
	time_t et_1 = clock();
	fprintf(stderr, "Execution time = %0.0lf ms\n", (et_1 - et_0) * 1000.0 / CLOCKS_PER_SEC);
#endif
	return 0;
}

#include <map>
#include <set>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
#define li		long long
#define rep(i,to)	for(li i=0;i<((li)to);i++)
#define pb		push_back
#define sz(v)		((li)v.size())

int main(){
	double x0,x1,y0,y1;
	vector<double> time;
	int n,k;
	scanf("%lf%lf%lf%lf%d",&x0,&y0,&x1,&y1,&n);
	rep(i,n){
		double t0,t1,t2,t3;
		scanf("%lf%lf%lf%lf",&t0,&t1,&t2,&t3);
		double ang=acos(abs(x1-t0)/sqrt((x1-t0)*(x1-t0)+(y1-t1)*(y1-t1)));
		if(x1>=t0 && y1>=t1) ang=ang;
		else if(x1>=t0 && y1<t1) ang=acos(-1)*2.0-ang;
		else if(x1<t0 && y1>=t1) ang=acos(-1)-ang;
		else ang=acos(-1)+ang;
		ang=max(t2,ang)-min(t2,ang);
		if(t3>0.000001)time.pb(min(acos(-1)*2.0-ang,ang)/t3);
	}
	scanf("%d",&k);
	if(sz(time)<=k){
		printf("0.000\n");
		return 0;
	}
	sort(time.begin(),time.end());
	printf("%.4lf\n",sqrt((x1-x0)*(x1-x0)+(y1-y0)*(y1-y0))/time[k]);
}

#include <cstdio>
#include <numeric>
#include <iostream>
#include <vector>
#include <set>
#include <cstring>
#include <string>
#include <map>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <queue>
#include <sstream>
#include <deque>

using namespace std;

#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i = 0; i < (n); i++)
#define re return
#define fi first
#define se second
#define sz(x) ((int) (x).size())
#define all(x) (x).begin(), (x).end()
#define sqr(x) ((x) * (x))
#define sqrt(x) sqrt(abs(x))
#define y0 y3487465
#define y1 y8687969
#define fill(x,y) memset(x,y,sizeof(x))

typedef vector<int> vi;
typedef long long ll;
typedef long double ld;
typedef double D;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
typedef vector<vi> vvi;

template<class T> T abs(T x) { re x > 0 ? x : -x; }

const double pi = 2 * asin (1.0);

int n;
int m;
double x[10000], y[10000], a[10000], w[10000];
double ax, ay, bx, by;

double dist (double x1, double y1, double x2, double y2) {
    re sqrt (sqr (x2 - x1) + sqr (y2 - y1));
}

double get (int i, double x, double y) {
    double b = atan2 (y - ::y[i], x - ::x[i]);
    re min (abs (a[i] - b), 2 * pi - abs (a[i] - b)) / w[i];
}

double cross (double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) {
    double a = x2 - x1;
    double b = x3 - x4;
    double c = x3 - x1;
    double d = y2 - y1;
    double e = y3 - y4;
    double f = y3 - y1;
    re (c * e - b * f) / (a * e - b * d);
}

int calc (double v) {
    int tmp = 0;
    double d = dist (ax, ay, bx, by);
    double dx = (bx - ax) / d;
    double dy = (by - ay) / d;
    double t = d / v;
    for (int i = 0; i < n; i++)
        if (get (i, bx, by) < t) tmp++; else {
            double l = 0, r = max (0.0, min (1.0, cross (ax, ay, bx, by, x[i], y[i], x[i] + (by - ay), y[i] + (ax - bx))));
            for (int it = 0; it < 200; it++) {
                double s1 = (2 * l + r) / 3;
                double s2 = (l + 2 * r) / 3;
                double d1 = get (i, ax + dx * s1, ay + dy * s1) - d * s1 / v;
                double d2 = get (i, ax + dx * s2, ay + dy * s2) - d * s2 / v;
                if (d1 < d2) r = s2; else l = s1;
            }
            double ss = (l + r) / 2;
            double dd = get (i, ax + dx * ss, ay + dy * ss) - d * ss / v;
            if (dd < 0) tmp++;
        }
    re tmp;
}

int main () {
    cin >> ax >> ay >> bx >> by >> n;
    for (int i = 0; i < n; i++)
        cin >> x[i] >> y[i] >> a[i] >> w[i];
    cin >> m;
    double l = 0, r = 1e18;
    for (int it = 0; it < 100; it++) {
        double s = (l + r) / 2;
        if (calc (s) <= m) r = s; else l = s;
    }
    printf ("%.10f\n", r);
    return 0;
}

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<set>
#include<vector>
#include<map>
#include<queue>
#include<string>
#include<bitset>
#include<iomanip>
#include<iostream>
#include<cmath>
using namespace std;
#define rep(i,x,y) for(i=x;i<=y;i++)
#define _rep(i,x,y) for(i=x;i>=y;i--)
#define REP(i,x,y) for(int i=(x);i<=(y);i++)
#define _REP(i,x,y) for(int i=(x);i>=(y);i--)
#define CL(S,x) memset(S,x,sizeof(S))
#define CP(S1,S2) memcpy(S1,S2,sizeof(S2))
#define ALL(x,S) for(__typeof((v).end()) x=S.begin();x!=S.end();x++)
#define pb push_back
#define IN insert
#define ER erase
#define BE begin()
#define ED end()
#define LB lower_bound
#define UB upper_bound
#define mp make_pair
#define fi first
#define se second
#define upmin(x,y) x=min(x,y)
#define upmax(x,y) x=max(x,y)
#define COUT(S,x) cout<<fixed<<setprecision(x)<<S<<endl
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;}

typedef long long ll;
typedef double ld;
typedef pair<int,int> pii;

const ld pi=2*acos(0);
struct node{ld x,y;};
void read(node&a){read(a.x,a.y);}
int sgn(ld 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,ld x){return(node){a.x*x,a.y*x};}
node operator/(node a,ld 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};}
ld operator*(node a,node b){return a.x*b.y-a.y*b.x;}
ld xj(node a,node b,node c){return (b-a)*(c-a);}
ld 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;ld L,R;
node A,B;
node a[11111];ld alp[11111],w[11111];

ld cc(ld x,ld v)
{
    if(v<0)v*=-1,x*=-1;
    while(x>=2*pi)x-=2*pi;
    while(x<0)x+=2*pi;
    return x/v;
}
bool ok(ld v)
{
    ld T=len(A-B)/v;int ans=0;
    rep(i,1,n)
    {
        ld a0=atan2(A.y-a[i].y,A.x-a[i].x);
        ld b0=atan2(B.y-a[i].y,B.x-a[i].x);
        ld k=(b0-a0)/T;

        ld t0=min(cc(alp[i]-a0,k-w[i]),
                  cc(alp[i]-a0,k+w[i]));
        ans+=(t0<=T);
    }
    return ans<=K;
}
int main()
{
    //freopen("1.in","r",stdin);freopen("1.out","w",stdout);
    read(A);read(B);
    read(n);rep(i,1,n)read(a[i]),scanf("%lf%lf",&alp[i],&w[i]),alp[i]-=2*pi;
    read(K);

    for(L=0,R=ld(1e10);R-L>=1e-5;)
    {
        ld mid=(L+R)/2;
        if(ok(mid))R=mid;else L=mid;
    }
    COUT((L+R)/2,10);

    return 0;
}

#pragma comment(linker, "/STACK:60777216")

#include <algorithm>
#include <iostream>
#include <complex>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <ctime>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

#define sz(a)                   int(a.size())
#define all(a)                  (a).begin(), (a).end()
#define CL(a, b)                memset(a, b, sizeof a)
#define FOR(i, a, b)			for (int i(a); i < (b); ++i)
#define REP(i, n)               FOR(i, 0, n)
#define UN(a)                   sort(all(a)), (a).erase(unique(all(a)), (a).end())
#define pb                      push_back
#define SORT(a)                 sort(all(a))

typedef long long ll;
typedef vector <int> vi;
typedef pair <int, int> pii;

double xa,ya,xb,yb;
int n;
double x[11111],y[11111],a[11111],w[11111];
int k;

const double pi = acos(-1.);

bool check(double v,double a,double w){
	int num = 55;
	REP(i,num+1){
		//if(!i) continue;
		double x = xa + (xb-xa)*i/double(num);
		double y = ya + (yb-ya)*i/double(num);
		double q = atan2(y,x) - a;

		if(q>2*pi) q-=2*pi;
		while(q<0) q+=2*pi;
		if(q>2*pi-q) q = 2*pi - q;

		//if(q<0)
	//		cout<<q<<endl;
	//	while(q<0);

		if(hypot(x-xa,y-ya)/v >=  (w < 1e-5 ? (i==0 ? 0 : 1e10) : q/w)) return 1;
	}

	return 0;
}

bool good(double s){
	int num = 0;
	REP(i,n){
		xa-=x[i],ya-=y[i],xb-=x[i],yb-=y[i];

		if(check(s,a[i],w[i]))
			num ++;

		xa+=x[i],ya+=y[i],xb+=x[i],yb+=y[i];

		if(num>k) return 0;
		if(num + n-i<=k) return 1;
	}
	return num <= k;
}

int main() {
#ifdef LocalHost
	freopen("input.txt", "r", stdin);
#endif

	cin>>xa>>ya>>xb>>yb>>n;
	REP(i,n) scanf("%lf %lf %lf %lf",x+i,y+i,a+i,w+i);
	cin>>k;

	double a = 0, b = 1e5, best = 1e5;
	REP(i,33){
		double s = (a+b)/2;
		if(good(s))
			best = s, b = s;
		else a = s;
	}
	printf("%.4lf\n",best);

	return 0;
}

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<set>
#include<vector>
#include<map>
#include<queue>
#include<string>
#include<bitset>
#include<iomanip>
#include<iostream>
#include<cmath>
using namespace std;
#define rep(i,x,y) for(i=x;i<=y;i++)
#define _rep(i,x,y) for(i=x;i>=y;i--)
#define REP(i,x,y) for(int i=(x);i<=(y);i++)
#define _REP(i,x,y) for(int i=(x);i>=(y);i--)
#define CL(S,x) memset(S,x,sizeof(S))
#define CP(S1,S2) memcpy(S1,S2,sizeof(S2))
#define ALL(x,S) for(__typeof((v).end()) x=S.begin();x!=S.end();x++)
#define pb push_back
#define IN insert
#define ER erase
#define BE begin()
#define ED end()
#define LB lower_bound
#define UB upper_bound
#define mp make_pair
#define fi first
#define se second
#define upmin(x,y) x=min(x,y)
#define upmax(x,y) x=max(x,y)
#define COUT(S,x) cout<<fixed<<setprecision(x)<<S<<endl
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;}

typedef long long ll;
typedef double ld;
typedef pair<int,int> pii;

const ld pi=2*acos(0);
struct node{ld x,y;};
void read(node&a){read(a.x,a.y);}
int sgn(ld 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,ld x){return(node){a.x*x,a.y*x};}
node operator/(node a,ld 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};}
ld operator*(node a,node b){return a.x*b.y-a.y*b.x;}
ld xj(node a,node b,node c){return (b-a)*(c-a);}
ld 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;ld L,R;
node A,B,C,D;ld alp,w,a[11111];

const int W=2000;
int main()
{
    //freopen("1.in","r",stdin);freopen("1.out","w",stdout);
    read(A);read(B);
    read(n);
    rep(i,1,n)
    {
        read(C);
        scanf("%lf%lf",&alp,&w);
        ld vmax=0,z;
        int cnt=0;
        {
            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;
            upmax(vmax,len(D-A)/(z/w+1e-12));
        }
        cnt=W;
        {
            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;
            upmax(vmax,len(D-A)/(z/w+1e-12));
        }
        a[i]=vmax;
    }
    read(K);sort(a+1,a+1+n);COUT(a[n-K],10);
    return 0;
}

#include <stdio.h>
#include <tchar.h>
#include<cmath>
#include<valarray>
#include<algorithm>
#include<functional>
#include<list>
#include<vector>
#include<map>
#include<iostream>

using namespace std;

typedef pair<double,double> Para;

int N;
int K;
Para A;
Para B;
const double pi=3.141592653589;
double H,L, W,T0,Fi;

valarray<double> tanks;

double rad(Para p1, Para p2);
double cosinus(Para,Para,Para);
Para ortohonal(Para p);

void Init();
double FindVelocity(double t1,double t2);
double MakeSolution();

int _tmain(int argc, _TCHAR* argv[])
{
   // ::freopen("stdin.txt","r",stdin);
    Init();
    double V=MakeSolution();
    printf("%.4lf\n",V);
    return 0;
}

void Init()
{
    double v1,v2,v3,x,y,alfa;
    cin>>x>>y; A=make_pair(x,y);
    cin>>x>>y; B=make_pair(x,y);
    cin>>N;
    tanks.resize(N);
    double D=hypot(B.first-A.first, B.second-A.second);
    Para p;
    for(int i=0;i<N;i++)
    {
        cin>>p.first>>p.second;
        cin>>alfa>>W;
        double a1=abs(alfa-rad(p,A));
        double a2=abs(alfa-rad(p,B));
        a1=min(a1,2*pi-a1);
        a2=min(a2,2*pi-a2);
        v1=(D*W)/a2;
        Para M=ortohonal(p);
        H=hypot(M.first-p.first,M.second-p.second);
        L=hypot(M.first-A.first,M.second-A.second);
        T0=a1/W;
        Fi=acos(cosinus(M,p,A));
        double t2=T0+Fi/W;
        v2=FindVelocity(T0,t2);
        v3=D/(T0+(acos(cosinus(A,p,B)))/W);
        tanks[i]=max(v1,max(v2,v3));
    }
    sort(&tanks[0],&tanks[N],std::greater<double>());
    cin>>K;
}

double MakeSolution()
{
    if(K==N) return 0;
    for(int i=K;i>0;i--)
    {
        if(tanks[i]!=tanks[i-1]) return tanks[i];
    }
    return tanks[0];
}

double rad(Para p1, Para p2)
{
    double x=p2.first-p1.first;
    double y=p2.second-p1.second;
    double t=y/x;
    double q=(t>0)?atan(t):pi-atan(abs(t));
    if(y<0) return pi+q;
    if(y==0)return (x>0)?0:pi;
    return q;
}

double cosinus(Para p1,Para p0,Para p2)
{
    double d1=sqrt(pow(p1.first-p0.first,2)+pow(p1.second-p0.second,2));
    double d2=sqrt(pow(p2.first-p0.first,2)+pow(p2.second-p0.second,2));
    double t=((p1.first-p0.first)*(p2.first-p0.first)+(p1.second-p0.second)*(p2.second-p0.second))/(d1*d2);
    return t;
}

Para ortohonal(Para p)
{
    double k=(B.second-A.second)/(B.first-A.first);
    if(k==0) return Para(p.first,A.second);
    Para Z((p.first+A.first)/2+(p.second-A.second)/2*k,0);
    Z.second=k*Z.first+A.second-k*A.first;
    return Z;
}

double FindVelocity(double t1,double t2)
{
    double x=L-H*tan(Fi-W*(t1-T0));
    double V1=(L-H*tan(Fi-W*(t1-T0)))/t1;
    double V2=(L-H*tan(Fi-W*(t2-T0)))/t2;
    if(abs(V2-V1)<0.0001) return V1;
    double t0=(t2+t1)/2;
    double delt=t0-0.5*(L*(1+cos(2*(Fi-W*(t0-T0))))/(H*W)-sin(2*(Fi-W*(t0-T0)))/W);
    if(delt<0) return FindVelocity(t1,t0);
    if(delt>0) return FindVelocity(t0,t2);
    if(delt==0) return (H*W)/pow(cos(Fi-W*(t0-T0)),2);
}

#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;
#define x first
#define y second
typedef double dbl;

typedef pair <dbl, dbl> pnt;

pnt operator - (pnt a, pnt b) {
  return pnt (a.x - b.x, a.y - b.y);
}

pnt st, dir;
dbl _w, _s, _len;

inline dbl f(dbl t) {
  dbl x = st.x + dir.x * t,
      y = st.y + dir.y * t;
  dbl r = atan2 (x, y) - _s;
  while (r < 0) {
    r += 2 * M_PI;
  }
  while (r > 2 * M_PI) {
    r -= 2 * M_PI;
  }
//  fprintf (stderr,  "%lf : %lf (%lf %lf)\n", _len * t * _w, max(r, 2 * M_PI - r), x, y);
  return _len * t * _w / min(r, 2 * M_PI - r);
}

dbl get (pnt a, pnt b, dbl s, dbl w) {
  st = a;
  dir = b - a;
  _s = s;
  _w = w;
  _len = hypot (dir.x, dir.y);

  dbl res = 0;
  for (int i = 0; i <= 200; i++) {
    dbl t = f (i / 200.);
    if (t > res) {
      res = t;
    }
  }
  return res;
}

void read (pnt &p) {
  double x, y;
  scanf ("%lf%lf", &x, &y);
  p.x = x;
  p.y = y;
}

int main (void) {
  pnt a, b;
  read(a);
  read(b);

  int n;
  scanf ("%d", &n);

  vector <dbl> v(1, 0);
  for (int i = 0; i < n; i++) {
    pnt p;
    read(p);
    double s, w;
    scanf("%lf%lf", &s, &w);
    v.push_back(get(a - p, b - p, s, w));
  }

  sort (v.begin(), v.end());
  reverse (v.begin(), v.end());
  int k;
  scanf ("%d", &k);
  printf ("%.20lf\n", v[k]);

  return 0;
}

#include <algorithm>
#include <iostream>
#include <sstream>
#include <complex>
#include <numeric>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

#define all(a)			(a).begin(), (a).end()
#define sz(a)			int((a).size())
#define FOR(i, a, b)	for (int i(a); i < b; ++i)
#define REP(i, n)		FOR(i, 0, n)
#define UN(v)			sort(all(v)), (v).erase(unique((v).begin(), (v).end()), (v).end())
#define CL(a, b)		memset(a, b, sizeof a)
#define pb				push_back
#define X				first
#define Y				second

typedef long long ll;
typedef vector <int> vi;
typedef pair <int, int> pii;

const double pi2 = acos(-1.0) * 2;

double g(double x, double y, double a, double v) {
	double c = atan2(y, x) - a;
	for (; c >= pi2; c -= pi2);
	for (; c < 0; c += pi2);
	return min(c, pi2 - c);
}

double f(double x0, double y0, double x1, double y1, double a, double v) {
	double dx = x1 - x0, dy = y1 - y0, d = sqrt(dx * dx + dy * dy);
	double res = 1 / g(x1, y1, a, v);
	for (double t = 1e-4; t < 1; t += 2e-4)
		res = max(res, t / g(x0 + dx * t, y0 + dy * t, a, v));
	double L = 1e-4, R = 1, l, r, fl, fr;
	REP (k, 256) {
		l = (L * 2 + R) / 3;
		r = (L + R * 2) / 3;
		fl = l / g(x0 + dx * l, y0 + dy * l, a, v);
		fr = r / g(x0 + dx * r, y0 + dy * r, a, v);
		if (fl < fr) {
			res = max(res, fr);
			L = l;
		} else {
			res = max(res, fl);
			R = r;
		}
	}
	return d * res;
}

int main(){
	#ifdef LocalHost
	freopen("x.in", "r", stdin);
	freopen("x.out", "w", stdout);
	#endif
	double Ax, Ay, Bx, By;
	int n;
	cin >> Ax >> Ay >> Bx >> By >> n;
	vector <double> v;
	REP (i, n) {
		double x, y, a, w;
		scanf("%lf%lf%lf%lf", &x, &y, &a, &w);
		v.pb(f(Ax - x, Ay - y, Bx - x, By - y, a, w));
	}
	sort(v.rbegin(), v.rend());
	v.pb(0);
	cin >> n;
	printf("%.12lf\n", v[n]);
	return 0;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
using namespace std;
const double pi=acos(-1.00),eps=1e-6;
struct point
{
    double x,y,w,a;
};
point st,en,tank[11111];
int n,k;
void norm(double &theta)
{
    while(theta<=-pi)
       theta+=2*pi;
    while(theta>pi)
       theta-=2*pi;
}
bool check(double v)
{
    int i,j,s,p,q,nk=0;
    double now_t,theta,T,dist=sqrt((st.x-en.x)*(st.x-en.x)+(st.y-en.y)*(st.y-en.y));
    double ltheta,rtheta,dtheta;
    T=dist/v;
//  printf("n")
    for(i=0;i<n;i++)
    {
        theta=atan2(en.y-tank[i].y,en.x-tank[i].x);
        rtheta=theta;
        ltheta=atan2(st.y-tank[i].y,st.x-tank[i].x);
        if(ltheta>rtheta)
            dtheta=rtheta+2*pi-ltheta;
        else
            dtheta=rtheta-ltheta;
        if(dtheta>pi)
            swap(ltheta,rtheta);
        if(ltheta>rtheta)
        {
            if(tank[i].a>rtheta-1e-9||tank[i].a<ltheta+1e-9)
            {
                nk++;
                continue;
            }
        }
        else
        {
            if(tank[i].a>ltheta-1e-9&&tank[i].a<rtheta+1e-9)
            {
                nk++;
                continue;
            }
        }
        if(tank[i].w==0)
            continue;
        else
        {
            if(theta<tank[i].a-1e-9)
               theta+=2*pi-tank[i].a;
            else
               theta-=tank[i].a;
            now_t=theta/tank[i].w;
            if(now_t<T+eps)
               nk++;
        }
        if(nk>k)
           return false;
    }
    return true;
}
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;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
using namespace std;
const double pi=acos(-1.00),eps=1e-9;
const int bound=1000;
struct point
{
    double x,y,w,a;
};
point st,en,tank[11111];
int n,k;
void norm(double &theta)
{
    while(theta<=-pi)
       theta+=2*pi;
    while(theta>pi)
       theta-=2*pi;
}
bool check(double v)
{
    int i,j,s,p,q,nk=0;
    double now_t,theta,T,dist=sqrt((st.x-en.x)*(st.x-en.x)+(st.y-en.y)*(st.y-en.y));
    double ltheta,rtheta,dtheta,low,high,mid,mt,vs,fs,bs,mx,my,fx,fy;
    int it;
    bool ft;
    T=dist/v;
//  printf("n")
    for(i=0;i<n;i++)
    {
    	double ds=((tank[i].x-st.x)*(en.y-st.y)-(tank[i].y-st.y)*(en.x-st.x));
    	if(fabs(ds)<eps)
    	{
	    	bool fk=false;
	    	if(tank[i].x<=max(st.x,en.x)+eps&&tank[i].x>=min(st.x,en.x)-eps&&tank[i].y<=max(st.y,en.y)+eps&&tank[i].y>=min(st.y,en.y)-eps)
	    	    fk=true;
	        if(fk)
	        {
	           nk++;
	           continue;
			}
		}
        theta=atan2(en.y-tank[i].y,en.x-tank[i].x);
        rtheta=theta;
        ltheta=atan2(st.y-tank[i].y,st.x-tank[i].x);
        if(ltheta>rtheta)
            dtheta=rtheta+2*pi-ltheta;
        else
            dtheta=rtheta-ltheta;
        ft=false;
        if(dtheta>pi)
            swap(ltheta,rtheta);
        if(ltheta<rtheta+eps)
        {
	       if(tank[i].a<rtheta+eps&&tank[i].a>ltheta-eps)
		  	    ft=true;
        }
        else
        {
        	if(tank[i].a<rtheta+eps||tank[i].a>ltheta-eps)
        	    ft=true;
        }
		if(tank[i].w==0)
		{
			if(ft)
			  nk++;
            continue;
		}
		else
        {
            if(theta<tank[i].a-1e-9)
               theta+=2*pi-tank[i].a;
            else
               theta-=tank[i].a;
            now_t=theta/tank[i].w;
            if(!ft&&now_t<T+eps)
            {
               nk++;
               continue;
			}
			if(ft&&now_t>T-eps)
			{
               nk++;
			   continue;
			}
			while(ltheta<tank[i].a-eps)
			   ltheta+=2*pi;
	        while(rtheta<tank[i].a-eps)
               rtheta+=2*pi;
         	theta=atan2(en.y-st.y,en.x-st.x);
			low=(ltheta-tank[i].a)/tank[i].w;
			high=(rtheta-tank[i].a)/tank[i].w;
			if(ltheta>rtheta)
			     low=0;
			mt=low;
			fs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
			mt=high;
			bs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
			if((fs<1e-4&&bs>-1e-4)||(fs>-1e-4&&bs<1e-4))
			{
		    	nk++;
				continue;
			}
			for(it=0;it<50;it++)
			{
				mx=mt=(2*low+high)/3.;
				fx=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
			    my=mt=(low+2*high)/3.;
			    fy=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
				if((fs>0&&fx>fy)||(fs<0&&fx<fy))
			        low=mx;
                else
                    high=my;
			}
	  	if(high-low>1e-6)
		    	{
	    			printf("high-low=%.9f\n",high-low);
	    		}
			mt=0.5*(low+high);
			fx=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
			if((fs>0&&fx<1e-4)||(fs<0&&fx>-1e-4))
			{
				nk++;
				continue;
			}
            if(ltheta>rtheta)
   	   	    {
    	   	   	low=(ltheta-tank[i].a)/tank[i].w;
    	   	   	high=2*pi/tank[i].w;
    	   	   	mt=low;
    	   	   	fs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
    	   	   	mt=high;
		    	bs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	     		if((fs<1e-4&&bs>-1e-4)||(fs>-1e-4&&bs<1e-4))
	    		{
	    	    	nk++;
	    			continue;
	    		}
	    		for(it=0;it<50;it++)
	    		{
	    			double mx,my,fx,fy;
	    			mx=mt=(2*low+high)/3.;
	    			fx=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	    		    my=mt=(low+2*high)/3.;
	    		    fy=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	    			if((fs>0&&fx>fy)||(fs<0&&fx<fy))
	    		        low=mx;
                    else
                        high=my;
		    	}
		    	if(high-low>1e-6)
		    	{
	    			printf("high-low=%.9f\n",high-low);
	    		}
	     		mt=0.5*(low+high);
	    		fx=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	    		if((fs>0&&fx<1e-4)||(fs<0&&fx>-1e-4))
	    		{
	    			nk++;
	    			continue;
	    		}
		     }
		}
        if(nk>k)
           return false;
    }
    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;
}

#include <stdio.h>
#include <tchar.h>
#include<cmath>
#include<valarray>
#include<algorithm>
#include<functional>
#include<list>
#include<vector>
#include<map>
#include<iostream>

using namespace std;

typedef pair<double,double> Para;

int N;
int K;
Para A;
Para B;
const double pi=3.141592653589;
double H,L, W,T0,Fi;

valarray<double> tanks;

double rad(Para p1, Para p2);
double cosinus(Para,Para,Para);
Para ortohonal(Para p);

void Init();
double FindVelocity(double t1,double t2);
double TestVelocity(Para p1,Para p2,Para x);
double MakeSolution();

int _tmain(int argc, _TCHAR* argv[])
{
   // ::freopen("stdin.txt","r",stdin);

    Init();
    double V=MakeSolution();
    printf("%.4lf\n",V);
    return 0;
}

void Init()
{
    double v1,v2,v3,x,y,alfa;
    cin>>x>>y; A=make_pair(x,y);
    cin>>x>>y; B=make_pair(x,y);
    cin>>N;
    tanks.resize(N);
    double D=hypot(B.first-A.first, B.second-A.second);
    Para p;
    for(int i=0;i<N;i++)
    {
        cin>>p.first>>p.second;
        cin>>alfa>>W;
        double a1=abs(alfa-rad(p,A));
        double a2=abs(alfa-rad(p,B));
        a1=min(a1,2*pi-a1);
        a2=min(a2,2*pi-a2);
        v1=(D*W)/a2;
        Para M=ortohonal(p);
        H=hypot(M.first-p.first,M.second-p.second);
        L=hypot(M.first-A.first,M.second-A.second);
        T0=a1/W;
        Fi=acos(cosinus(M,p,A));
        double t2=T0+Fi/W;
        //double v22=FindVelocity(T0,t2);
        v2=TestVelocity(A,M,p);
        v3=D/(T0+(acos(cosinus(A,p,B)))/W);
        tanks[i]=max(v1,max(v2,v3));
    }
    sort(&tanks[0],&tanks[N],std::greater<double>());
    cin>>K;
}

double MakeSolution()
{
    if(K==N) return 0;
    for(int i=K;i>0;i--)
    {
        if(tanks[i]!=tanks[i-1]) return tanks[i];
    }
    return tanks[0];
}

double rad(Para p1, Para p2)
{
    double x=p2.first-p1.first;
    double y=p2.second-p1.second;
    double t=y/x;
    double q=(t>0)?atan(t):pi-atan(abs(t));
    if(y<0) return pi+q;
    if(y==0)return (x>0)?0:pi;
    return q;
}

double cosinus(Para p1,Para p0,Para p2)
{
    double d1=sqrt(pow(p1.first-p0.first,2)+pow(p1.second-p0.second,2));
    double d2=sqrt(pow(p2.first-p0.first,2)+pow(p2.second-p0.second,2));
    double t=((p1.first-p0.first)*(p2.first-p0.first)+(p1.second-p0.second)*(p2.second-p0.second))/(d1*d2);
    return t;
}

Para ortohonal(Para p)
{
    double k=(B.second-A.second)/(B.first-A.first);
    if(k==0) return Para(p.first,A.second);
    Para Z((p.first+A.first)/2+(p.second-A.second)/2*k,0);
    Z.second=k*Z.first+A.second-k*A.first;
    return Z;
}

double FindVelocity(double t1,double t2)
{
    double x=L-H*tan(Fi-W*(t1-T0));
    double V1=(L-H*tan(Fi-W*(t1-T0)))/t1;
    double V2=(L-H*tan(Fi-W*(t2-T0)))/t2;
    if(abs(V2-V1)<0.0001) return V1;
    double t0=(t2+t1)/2;
    double delt=t0-0.5*(L*(1+cos(2*(Fi-W*(t0-T0))))/(H*W)-sin(2*(Fi-W*(t0-T0)))/W);
    if(delt<0) return FindVelocity(t1,t0);
    if(delt>0) return FindVelocity(t0,t2);
    if(delt==0) return (H*W)/pow(cos(Fi-W*(t0-T0)),2);
}

double TestVelocity(Para p1,Para p2,Para r)
{
    double tmp=0;
    for(int i=0;i<=1000;i++)
    {
        double x=p1.first+(p2.first-p1.first)*i/1000.;
        double y=p1.second+(p2.second-p1.second)*i/1000.;
        double phi=std::acos(cosinus(p1,r,make_pair(x,y)));
        double time=T0+(phi/W);
        tmp=max(tmp,hypot(x-p1.first,y-p1.second)/time);
    }
    return tmp;
}

#include <algorithm>
#include <iostream>
#include <sstream>
#include <complex>
#include <numeric>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

#define all(a)			(a).begin(), (a).end()
#define sz(a)			int((a).size())
#define FOR(i, a, b)	for (int i(a); i < b; ++i)
#define REP(i, n)		FOR(i, 0, n)
#define UN(v)			sort(all(v)), (v).erase(unique((v).begin(), (v).end()), (v).end())
#define CL(a, b)		memset(a, b, sizeof a)
#define pb				push_back
#define X				first
#define Y				second

typedef long long ll;
typedef vector <int> vi;
typedef pair <int, int> pii;

const double pi2 = acos(-1.0) * 2;

double g(double x, double y, double a, double v) {
	double c = atan2(y, x) - a;
	if (c < 0) c += pi2;
	return min(c, pi2 - c);
}

double f(double x0, double y0, double x1, double y1, double a, double v) {
	double dx = x1 - x0, dy = y1 - y0, d = sqrt(dx * dx + dy * dy);
	double res = g(x1, y1, a, v) / d;
	for (double t = 1e-4; t < 1; t += 2e-4)
		res = min(res, g(x0 + dx * t, y0 + dy * t, a, v) / t);
	double L = 1e-4, R = 1, l, r, fl, fr;
	REP (k, 256) {
		l = (L * 2 + R) / 3;
		r = (L + R * 2) / 3;
		fl = g(x0 + dx * l, y0 + dy * l, a, v) / (l);
		fr = g(x0 + dx * r, y0 + dy * r, a, v) / (r);
		if (fl < fr) {
			res = min(res, fl);
			R = r;
		} else {
			res = min(res, fr);
			L = l;
		}
	}
	return d / res;
}

int main(){
	#ifdef LocalHost
	freopen("x.in", "r", stdin);
	freopen("x.out", "w", stdout);
	#endif
	double Ax, Ay, Bx, By;
	int n;
	cin >> Ax >> Ay >> Bx >> By >> n;
	vector <double> v;
	REP (i, n) {
		double x, y, a, w;
		scanf("%lf%lf%lf%lf", &x, &y, &a, &w);
		x = 5;
		y = -5;
		a = 4.71238;
		w = 1;
		v.pb(f(Ax - x, Ay - y, Bx - x, By - y, a, w));
	}
	sort(v.rbegin(), v.rend());
	v.pb(0);
	int k;
	cin >> k;
	printf("%.12lf\n", v[k]);
	return 0;
}

#pragma comment(linker, "/STACK:60777216")

#include <algorithm>
#include <iostream>
#include <complex>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <ctime>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

#define sz(a)                   int(a.size())
#define all(a)                  (a).begin(), (a).end()
#define CL(a, b)                memset(a, b, sizeof a)
#define FOR(i, a, b)			for (int i(a); i < (b); ++i)
#define REP(i, n)               FOR(i, 0, n)
#define UN(a)                   sort(all(a)), (a).erase(unique(all(a)), (a).end())
#define pb                      push_back
#define SORT(a)                 sort(all(a))

typedef long long ll;
typedef vector <int> vi;
typedef pair <int, int> pii;

double xa,ya,xb,yb;
int n;
double x[11111],y[11111],a[11111],w[11111];
int k;

const double pi = acos(-1.);

bool check(double v,double a,double w){
	int num = 100;
	REP(i,num+1){
		//if(!i) continue;
		double x = xa + (xb-xa)*i/double(num);
		double y = ya + (yb-ya)*i/double(num);
		double q = atan2(y,x) - a;

		if(q>2*pi) q-=2*pi;
		if(q<0) q+=2*pi;
		if(q>2*pi-q) q = 2*pi - q;

		if(hypot(x-xa,y-ya)/v >=  (w < 1e-5 ? (i==0 ? 0 : 1e10) : q/w)) return 1;
	}

	return 0;
}

bool good(double s){
	int num = 0;
	REP(i,n){
		xa-=x[i],ya-=y[i],xb-=x[i],yb-=y[i];

		if(check(s,a[i],w[i]))
			num ++;

		xa+=x[i],ya+=y[i],xb+=x[i],yb+=y[i];
	}
	return num <= k;
}

int main() {
#ifdef LocalHost
	freopen("input.txt", "r", stdin);
#endif

	cin>>xa>>ya>>xb>>yb>>n;
	REP(i,n) scanf("%lf %lf %lf %lf",x+i,y+i,a+i,w+i);
	cin>>k;

	double a = 0, b = 1e6, best = 1e6;
	REP(i,40){
		double s = (a+b)/2;
		if(good(s))
			best = s, b = s;
		else a = s;
	}
	printf("%.4lf\n",best);

	return 0;
}

#include <cstdio>
#include <numeric>
#include <iostream>
#include <vector>
#include <set>
#include <cstring>
#include <string>
#include <map>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <queue>
#include <sstream>
#include <deque>

using namespace std;

#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i = 0; i < (n); i++)
#define re return
#define fi first
#define se second
#define sz(x) ((int) (x).size())
#define all(x) (x).begin(), (x).end()
#define sqr(x) ((x) * (x))
#define sqrt(x) sqrt(abs(x))
#define y0 y3487465
#define y1 y8687969
#define fill(x,y) memset(x,y,sizeof(x))

typedef vector<int> vi;
typedef long long ll;
typedef long double ld;
typedef double D;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
typedef vector<vi> vvi;

template<class T> T abs(T x) { re x > 0 ? x : -x; }

const double pi = 2 * asin (1.0);

int n;
int m;
double x[10000], y[10000], a[10000], w[10000];
double ax, ay, bx, by;

double dist (double x1, double y1, double x2, double y2) {
    re sqrt (sqr (x2 - x1) + sqr (y2 - y1));
}

double get (int i, double x, double y) {
    double b = atan2 (y - ::y[i], x - ::x[i]);
    re min (abs (a[i] - b), 2 * pi - abs (a[i] - b)) / w[i];
}

double cross (double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) {
    double a = x2 - x1;
    double b = x3 - x4;
    double c = x3 - x1;
    double d = y2 - y1;
    double e = y3 - y4;
    double f = y3 - y1;
    re (c * e - b * f) / (a * e - b * d);
}

int calc (double v) {
    int tmp = 0;
    double d = dist (ax, ay, bx, by);
    double dx = (bx - ax);
    double dy = (by - ay);
    double t = d / v;
    for (int i = 0; i < n; i++) {
        if (w[i] < 1e-6) continue;
        if (get (i, bx, by) < t) tmp++; else {
            double l = 0, r = max (0.0, min (1.0, cross (ax, ay, bx, by, x[i], y[i], x[i] + (by - ay), y[i] + (ax - bx))));
            for (int it = 0; it < 60; it++) {
                double s1 = (2 * l + r) / 3;
                double s2 = (l + 2 * r) / 3;
                double d1 = get (i, ax + dx * s1, ay + dy * s1) - t * s1;
                double d2 = get (i, ax + dx * s2, ay + dy * s2) - t * s2;
                if (d1 < d2) r = s2; else l = s1;
            }
            double ss = (l + r) / 2;
            double dd = get (i, ax + dx * ss, ay + dy * ss) - t * ss;
            if (dd < 0) tmp++;
        }
        }
    re tmp;
}

int main () {
    cin >> ax >> ay >> bx >> by >> n;
    for (int i = 0; i < n; i++)
        cin >> x[i] >> y[i] >> a[i] >> w[i];
    cin >> m;
    double l = 0, r = 1e18;
    for (int it = 0; it < 100; it++) {
        double s = (l + r) / 2;
        if (calc (s) <= m) r = s; else l = s;
    }
    printf ("%.10f\n", r);
    return 0;
}

#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;
#define x first
#define y second
typedef double dbl;

typedef pair <dbl, dbl> pnt;

pnt operator - (pnt a, pnt b) {
  return pnt (a.x - b.x, a.y - b.y);
}

pnt st, dir;
dbl _w, _s, _len;

inline dbl f(dbl t) {
  dbl x = st.x + dir.x * t,
      y = st.y + dir.y * t;
  dbl r = atan2 (y, x) - _s;
  while (r < 0) {
    r += 2 * M_PI;
  }
  while (r > 2 * M_PI) {
    r -= 2 * M_PI;
  }
//  fprintf (stderr,  "%lf : %lf (%lf %lf) | %lf\n", _len * t * _w, min(r, 2 * M_PI - r), x, y, r);
  return _len * t * _w / min(r, 2 * M_PI - r);
}

dbl get (pnt a, pnt b, dbl s, dbl w) {
  st = a;
  dir = b - a;
  _s = s;
  _w = w;
  _len = hypot (dir.x, dir.y);

  dbl res = 0;
  for (int i = 0; i <= 70; i++) {
    dbl t = f (i / 70.);
    if (t > res) {
      res = t;
    }
  }
  return res;
}

void read (pnt &p) {
  double x, y;
  scanf ("%lf%lf", &x, &y);
  p.x = x;
  p.y = y;
}

int main (void) {
  pnt a, b;
  read(a);
  read(b);

  int n;
  scanf ("%d", &n);

  vector <dbl> v(1, 0);
  for (int i = 0; i < n; i++) {
    pnt p;
    read(p);
    double s, w;
    scanf("%lf%lf", &s, &w);
    v.push_back(get(a - p, b - p, s, w));
  }

  sort (v.begin(), v.end());
  reverse (v.begin(), v.end());
  int k;
  scanf ("%d", &k);
  printf ("%.20lf\n", v[k]);

  return 0;
}

#pragma comment(linker, "/STACK:60777216")

#include <algorithm>
#include <iostream>
#include <complex>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <ctime>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

#define sz(a)                   int(a.size())
#define all(a)                  (a).begin(), (a).end()
#define CL(a, b)                memset(a, b, sizeof a)
#define FOR(i, a, b)			for (int i(a); i < (b); ++i)
#define REP(i, n)               FOR(i, 0, n)
#define UN(a)                   sort(all(a)), (a).erase(unique(all(a)), (a).end())
#define pb                      push_back
#define SORT(a)                 sort(all(a))

typedef long long ll;
typedef vector <int> vi;
typedef pair <int, int> pii;

double xa,ya,xb,yb;
int n;
double x[11111],y[11111],a[11111],w[11111];
int k;

const double pi = acos(-1.);

bool check(double v,double a,double w){
	int num = 50;
	REP(i,num+1){
		//if(!i) continue;
		double x = xa + (xb-xa)*i/double(num);
		double y = ya + (yb-ya)*i/double(num);
		double q = atan2(y,x) - a;

		if(q>2*pi) q-=2*pi;
		while(q<0) q+=2*pi;
		if(q>2*pi-q) q = 2*pi - q;

		//if(q<0)
	//		cout<<q<<endl;
	//	while(q<0);

		if(hypot(x-xa,y-ya)/v >=  (w < 1e-5 ? (i==0 ? 0 : 1e10) : q/w)) return 1;
	}

	return 0;
}

bool good(double s){
	int num = 0;
	REP(i,n){
		xa-=x[i],ya-=y[i],xb-=x[i],yb-=y[i];

		if(check(s,a[i],w[i]))
			num ++;

		xa+=x[i],ya+=y[i],xb+=x[i],yb+=y[i];
	}
	return num <= k;
}

int main() {
#ifdef LocalHost
	freopen("input.txt", "r", stdin);
#endif

	cin>>xa>>ya>>xb>>yb>>n;
	REP(i,n) scanf("%lf %lf %lf %lf",x+i,y+i,a+i,w+i);
	cin>>k;

	double a = 0, b = 1e6, best = 1e6;
	REP(i,40){
		double s = (a+b)/2;
		if(good(s))
			best = s, b = s;
		else a = s;
	}
	printf("%.4lf\n",best);

	return 0;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
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)
       theta+=2*pi;
    while(theta>pi)
       theta-=2*pi;
}
bool check(double v)
{
    int i,j,s,p,q,nk=0;
    double now_t,theta,T,dist=sqrt((st.x-en.x)*(st.x-en.x)+(st.y-en.y)*(st.y-en.y));
    double ltheta,rtheta,dtheta,lt,rt;
    bool ft;
    T=dist/v;
//  printf("n")
    for(i=0;i<n;i++)
    {
    	double ds=((tank[i].x-st.x)*(en.y-st.y)-(tank[i].y-st.y)*(en.x-st.x));
    	if(fabs(ds)<eps)
    	{
	    	bool fk=false;
	    	if(tank[i].x<=max(st.x,en.x)+eps&&tank[i].x>=min(st.x,en.x)-eps&&tank[i].y<=max(st.y,en.y)+eps&&tank[i].y>=min(st.y,en.y)-eps)
	    	    fk=true;
	        if(fk)
	        {
	           nk++;
	           continue;
			}
		}
        theta=atan2(en.y-tank[i].y,en.x-tank[i].x);
        rtheta=theta;
        ltheta=atan2(st.y-tank[i].y,st.x-tank[i].x);
        if(ltheta>rtheta)
            dtheta=rtheta+2*pi-ltheta;
        else
            dtheta=rtheta-ltheta;
        ft=false;
        if(dtheta>pi)
            swap(ltheta,rtheta);
        if(ltheta<rtheta+eps)
        {
	       if(tank[i].a<rtheta+eps&&tank[i].a>ltheta-eps)
		  	    ft=true;
        }
        else
        {
        	if(tank[i].a<rtheta+eps||tank[i].a>ltheta-eps)
        	    ft=true;
        }
		if(tank[i].w==0)
		{
			if(ft)
			  nk++;
            continue;
		}
		else
        {
            if(theta<tank[i].a-1e-9)
               theta+=2*pi-tank[i].a;
            else
               theta-=tank[i].a;
            now_t=theta/tank[i].w;
            if(!ft&&now_t<T+eps)
            {
               nk++;
               continue;
			}
			if(ft&&now_t>T-eps)
			{
               nk++;
			   continue;
			}
			while(ltheta<tank[i].a-eps)
			   ltheta+=2*pi;
	        while(rtheta<tank[i].a-eps)
               rtheta+=2*pi;
			assert((ft&&ltheta>rtheta)||(!ft&&ltheta<rtheta));
		}
        if(nk>k)
           return false;
    }
    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;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
using namespace std;
const double pi=acos(-1.00),eps=1e-9;
const int bound=1000;
struct point
{
    double x,y,w,a;
};
point st,en,tank[11111];
int n,k;
void norm(double &theta)
{
    while(theta<=-pi)
       theta+=2*pi;
    while(theta>pi)
       theta-=2*pi;
}
bool check(double v)
{
    int i,j,s,p,q,nk=0;
    double now_t,theta,T,dist=sqrt((st.x-en.x)*(st.x-en.x)+(st.y-en.y)*(st.y-en.y));
    double ltheta,rtheta,dtheta,low,high,mid,mt,vs,fs,bs,mx,my,fx,fy;
    int it;
    bool ft;
    T=dist/v;
//  printf("n")
    for(i=0;i<n;i++)
    {
    	double ds=((tank[i].x-st.x)*(en.y-st.y)-(tank[i].y-st.y)*(en.x-st.x));
    	if(fabs(ds)<eps)
    	{
	    	bool fk=false;
	    	if(tank[i].x<=max(st.x,en.x)+eps&&tank[i].x>=min(st.x,en.x)-eps&&tank[i].y<=max(st.y,en.y)+eps&&tank[i].y>=min(st.y,en.y)-eps)
	    	    fk=true;
	        if(fk)
	        {
	           nk++;
	           continue;
			}
		}
        theta=atan2(en.y-tank[i].y,en.x-tank[i].x);
        rtheta=theta;
        ltheta=atan2(st.y-tank[i].y,st.x-tank[i].x);
        if(ltheta>rtheta)
            dtheta=rtheta+2*pi-ltheta;
        else
            dtheta=rtheta-ltheta;
        ft=false;
        if(dtheta>pi)
            swap(ltheta,rtheta);
        if(ltheta<rtheta+eps)
        {
	       if(tank[i].a<rtheta+eps&&tank[i].a>ltheta-eps)
		  	    ft=true;
        }
        else
        {
        	if(tank[i].a<rtheta+eps||tank[i].a>ltheta-eps)
        	    ft=true;
        }
		if(tank[i].w==0)
		{
			if(ft)
			  nk++;
            continue;
		}
		else
        {
			while(ltheta<tank[i].a-eps)
			   ltheta+=2*pi;
	        while(rtheta<tank[i].a-eps)
               rtheta+=2*pi;
         	theta=atan2(en.y-st.y,en.x-st.x);
			low=(ltheta-tank[i].a)/tank[i].w;
			high=(rtheta-tank[i].a)/tank[i].w;
			assert((ltheta<rtheta&&!ft)||(ltheta>rtheta&&ft));
			if(ltheta>rtheta)
			     low=0;
			mt=low;
			fs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
			mt=high;
			bs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
			if((fs<1e-4&&bs>-1e-4)||(fs>-1e-4&&bs<1e-4))
			{
		    	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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
			    my=mt=(low+2*high)/3.;
			    fy=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
			if((fs>0&&fx<1e-4)||(fs<0&&fx>-1e-4))
			{
				nk++;
				continue;
			}
            if(ltheta>rtheta)
   	   	    {
    	   	   	low=(ltheta-tank[i].a)/tank[i].w;
    	   	   	high=2*pi/tank[i].w;
    	   	   	mt=low;
    	   	   	fs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
    	   	   	mt=high;
		    	bs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	     		if((fs<1e-4&&bs>-1e-4)||(fs>-1e-4&&bs<1e-4))
	    		{
	    	    	nk++;
	    			continue;
	    		}
	    		for(it=0;it<100;it++)
	    		{
	    			double mx,my,fx,fy;
	    			mx=mt=(2*low+high)/3.;
	    			fx=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	    		    my=mt=(low+2*high)/3.;
	    		    fy=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	    		if((fs>0&&fx<1e-4)||(fs<0&&fx>-1e-4))
	    		{
	    			nk++;
	    			continue;
	    		}
		     }
		}
        if(nk>k)
           return false;
    }
    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;
}

#pragma comment(linker, "/STACK:60777216")

#include <algorithm>
#include <iostream>
#include <complex>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <ctime>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

#define sz(a)                   int(a.size())
#define all(a)                  (a).begin(), (a).end()
#define CL(a, b)                memset(a, b, sizeof a)
#define FOR(i, a, b)			for (int i(a); i < (b); ++i)
#define REP(i, n)               FOR(i, 0, n)
#define UN(a)                   sort(all(a)), (a).erase(unique(all(a)), (a).end())
#define pb                      push_back
#define SORT(a)                 sort(all(a))

typedef long long ll;
typedef vector <int> vi;
typedef pair <int, int> pii;

double xa,ya,xb,yb;
int n;
double x[11111],y[11111],a[11111],w[11111];
int k;

const double pi = acos(-1.);

bool check(double v,double a,double w){
	int num = 1;
	REP(i,num+1){
		if(!i) continue;
		double x = xa + (xb-xa)*i/double(num);
		double y = ya + (yb-ya)*i/double(num);
		double q = atan2(y,x) - a;

		if(q>2*pi) q-=2*pi;
		if(q<0) q+=2*pi;
		if(q>2*pi-q) q = 2*pi - q;

		if(hypot(x-xa,y-ya)/v >=  (w < 1e-5 ? (i==0 ? 0 : 1e10) : q/w)) return 1;
	}

	return 0;
}

bool good(double s){
	int num = 0;
	REP(i,n){
		xa-=x[i],ya-=y[i],xb-=x[i],yb-=y[i];

		if(check(s,a[i],w[i]))
			num ++;

		xa+=x[i],ya+=y[i],xb+=x[i],yb+=y[i];
	}
	return num <= k;
}

int main() {
#ifdef LocalHost
	freopen("input.txt", "r", stdin);
#endif

	cin>>xa>>ya>>xb>>yb>>n;
	REP(i,n) scanf("%lf %lf %lf %lf",x+i,y+i,a+i,w+i);
	cin>>k;

	double a = 0, b = 1e6, best = 1e6;
	REP(i,40){
		double s = (a+b)/2;
		if(good(s))
			best = s, b = s;
		else a = s;
	}
	printf("%.4lf\n",best);

	return 0;
}

#pragma comment(linker, "/STACK:60777216")

#include <algorithm>
#include <iostream>
#include <complex>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <ctime>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

#define sz(a)                   int(a.size())
#define all(a)                  (a).begin(), (a).end()
#define CL(a, b)                memset(a, b, sizeof a)
#define FOR(i, a, b)			for (int i(a); i < (b); ++i)
#define REP(i, n)               FOR(i, 0, n)
#define UN(a)                   sort(all(a)), (a).erase(unique(all(a)), (a).end())
#define pb                      push_back
#define SORT(a)                 sort(all(a))

typedef long long ll;
typedef vector <int> vi;
typedef pair <int, int> pii;

double xa,ya,xb,yb;
int n;
double x[11111],y[11111],a[11111],w[11111];
int k;

const double pi = acos(-1.);

bool check(double v,double a,double w){
	int num = 1;
	REP(i,num+1){
		if(!i) continue;
		double x = xa + (xb-xa)*i/double(num);
		double y = ya + (yb-ya)*i/double(num);
		double q = atan2(y,x) - a;

		if(q>2*pi) q-=2*pi;
		if(q<0) q+=2*pi;
		if(q>2*pi-q) q = 2*pi - q;
		q/=w;

		if(hypot(x-xa,y-ya)/v >= q) return 1;
	}

	return 0;
}

bool good(double s){
	int num = 0;
	REP(i,n){
		xa-=x[i],ya-=y[i],xb-=x[i],yb-=y[i];

		if(check(s,a[i],w[i]))
			num ++;

		xa+=x[i],ya+=y[i],xb+=x[i],yb+=y[i];
	}
	return num <= k;
}

int main() {
#ifdef LocalHost
	freopen("input.txt", "r", stdin);
#endif

	cin>>xa>>ya>>xb>>yb>>n;
	REP(i,n) scanf("%lf %lf %lf %lf",x+i,y+i,a+i,w+i);
	cin>>k;

	double a = 0, b = 1e6, best = 1e6;
	REP(i,40){
		double s = (a+b)/2;
		if(good(s))
			best = s, b = s;
		else a = s;
	}
	printf("%.4lf\n",best);

	return 0;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

#define clr(x) memset((x), 0, sizeof(x))
#define pb push_back
#define mp make_pair
#define sz size()
#define For(i, st, en) for(int i=(st); i<=(int)(en); i++)
#define Ford(i, st, en) for(int i=(st); i>=(int)(en); i--)
#define forn(i, n) for(int i=0; i<(int)(n); i++)
#define ford(i, n) for(int i=(n)-1; i>=0; i--)
#define fori(it, x) for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)

template <class _T> inline _T sqr(const _T& x) { return x * x; }
template <class _T> inline string tostr(const _T& a) { ostringstream os(""); os << a; return os.str(); }

typedef double ld;

// Constants
const ld PI = 3.1415926535897932384626433832795;
const ld EPS = 1e-11;

// Types
typedef long long i64;
typedef set < int > SI;
typedef vector < int > VI;
typedef map < string, int > MSI;
typedef pair < int, int > PII;

struct tp{ld x,y;};

int n, k;
tp a[10240];
ld ang[10240];
ld w[10240];
tp p1, p2;
ld b0[10240];
ld tt;

inline ld dist(tp p1, tp p2)
{
	return sqrt(sqr(p1.x-p2.x) + sqr(p1.y-p2.y));
}

inline bool hit(ld s, int i)
{
	if (w[i] < EPS) return false;
	ld da = fabs(ang[i] - b0[i]);
	da = min(da, 2.0 * PI - da);
	ld t = da / w[i];
	if (t <= tt) return true;

	int z = 1;
	forn(j, z)
	{
		ld mi = j * 1.0 / z;
		ld ma = (j + 1.0) / z;
		forn(tt, 101)
		{
			if (ma - mi < 1e-13) break;
			ld q1 = (mi * 2.0 + ma) / 3.0;
			ld q2 = (mi + 2.0 * ma) / 3.0;

			tp pp1, pp2;
			pp1.x = p1.x + (p2.x - p1.x) * q1;
			pp1.y = p1.y + (p2.y - p1.y) * q1;
			pp2.x = p1.x + (p2.x - p1.x) * q2;
			pp2.y = p1.y + (p2.y - p1.y) * q2;
			ld aa1 = atan2(pp1.y - a[i].y, pp1.x - a[i].x);
			ld aa2 = atan2(pp2.y - a[i].y, pp2.x - a[i].x);
			ld a1 = fabs(ang[i] - aa1);
			a1 = min(a1, 2.0 * PI - a1);
			ld a2 = fabs(ang[i] - aa2);
			a2 = min(a2, 2.0 * PI - a2);
			ld t1 = a1 / w[i];
			ld t2 = a2 / w[i];
			ld d1 = dist(p1, pp1);
			ld d2 = dist(p1, pp2);
			t1 -= d1 / s;
			t2 -= d2 / s;
			if (t1 <= 0.0) return true;
			if (t2 <= 0.0) return true;
			if (t1 < t2) ma = q2;
			else mi = q1;
		}
	}
	return false;
}

bool check(ld s)
{
	int cnt = 0;
	tt = dist(p1, p2) / s;
	forn(i, n)
	{
		if (cnt + n - i <= k) return true;
		cnt += hit(s, i);
		if (cnt > k) return false;
	}
	return cnt <= k;
}

int main()
{
#ifdef ROOM_311
	time_t et_0 = clock();
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif
	cout << setiosflags(ios::fixed) << setprecision(10);

	int x, y;
	scanf("%d%d", &x, &y);
	p1.x = x;
	p1.y = y;
	scanf("%d%d", &x, &y);
	p2.x = x;
	p2.y = y;
	scanf("%d", &n);
	forn(i, n)
	{
		scanf("%d%d", &x, &y);
		a[i].x = x;
		a[i].y = y;
		double aa, ww;
		scanf("%lf%lf", &aa, &ww);
		if (aa > PI)
		{
			aa -= 2.0 * PI;
		}
		ang[i] = aa;
		w[i] = ww;
	}
	scanf("%d", &k);
	forn(i, n)
	{
		b0[i] = atan2(p2.y - a[i].y, p2.x - a[i].x);
	}

	ld mi = 3e-5;
	ld ma = 1e+6;

	while (ma - mi > 3e-5 && (ma - mi) / (ma + mi) > 3e-6)
	{
		ld q = (mi + ma) * 0.5;
		*(check(q) ? &ma : &mi) = q;
	}
	printf("%0.5lf\n", (double)mi);

#ifdef ROOM_311
	time_t et_1 = clock();
	fprintf(stderr, "Execution time = %0.0lf ms\n", (et_1 - et_0) * 1000.0 / CLOCKS_PER_SEC);
#endif
	return 0;
}

#include <stdio.h>
#include <tchar.h>
#include<cmath>
#include<valarray>
#include<algorithm>
#include<functional>
#include<list>
#include<vector>
#include<map>
#include<iostream>

using namespace std;

typedef pair<double,double> Para;

int N;
int K;
Para A;
Para B;
const double pi=3.141592653589;
double H,L, W,T0,Fi;

valarray<double> tanks;

double rad(Para p1, Para p2);
double cosinus(Para,Para,Para);
Para ortohonal(Para p);

void Init();
double FindVelocity(double t1,double t2);
double MakeSolution();

int _tmain(int argc, _TCHAR* argv[])
{
    //::freopen("stdin.txt","r",stdin);

    Init();
    double V=MakeSolution();
    printf("%.4lf\n",V);
    return 0;
}

void Init()
{
    double v1,v2,v3,x,y,alfa;
    cin>>x>>y; A=make_pair(x,y);
    cin>>x>>y; B=make_pair(x,y);
    cin>>N;
    tanks.resize(N);
    double D=hypot(B.first-A.first, B.second-A.second);
    Para p;
    for(int i=0;i<N;i++)
    {
        cin>>p.first>>p.second;
        cin>>alfa>>W;
        double a1=abs(alfa-rad(p,A));
        double a2=abs(alfa-rad(p,B));
        a1=min(a1,2*pi-a1);
        a2=min(a2,2*pi-a2);
        v1=(D*W)/a2;
        Para M=ortohonal(p);
        H=hypot(M.first-p.first,M.second-p.second);
        L=hypot(M.first-A.first,M.second-A.second);
        T0=a1/W;
        Fi=acos(cosinus(M,p,A));
        double t2=T0+Fi/W;
        v2=FindVelocity(T0,t2);
        v3=D/(T0+(acos(cosinus(A,p,B)))/W);
        tanks[i]=max(v1,max(v2,v3));
    }
    sort(&tanks[0],&tanks[N],std::greater<double>());
    cin>>K;
}

double MakeSolution()
{
    if(K==N) return 0;
    /*for(int i=K;i>0;i--)
    {
        if(tanks[i]!=tanks[i-1]) return tanks[i];
    }*/
    return tanks[K-1];
}

double rad(Para p1, Para p2)
{
    double x=p2.first-p1.first;
    double y=p2.second-p1.second;
    double t=y/x;
    double q=(t>0)?atan(t):pi-atan(abs(t));
    if(y<0) return pi+q;
    if(y==0)return (x>0)?0:pi;
    return q;
}

double cosinus(Para p1,Para p0,Para p2)
{
    double d1=sqrt(pow(p1.first-p0.first,2)+pow(p1.second-p0.second,2));
    double d2=sqrt(pow(p2.first-p0.first,2)+pow(p2.second-p0.second,2));
    double t=((p1.first-p0.first)*(p2.first-p0.first)+(p1.second-p0.second)*(p2.second-p0.second))/(d1*d2);
    return t;
}

Para ortohonal(Para p)
{
    double k=(B.second-A.second)/(B.first-A.first);
    if(k==0) return Para(p.first,A.second);
    Para Z((p.first+A.first)/2+(p.second-A.second)/2*k,0);
    Z.second=k*Z.first+A.second-k*A.first;
    return Z;
}

double FindVelocity(double t1,double t2)
{
    double x=L-H*tan(Fi-W*(t1-T0));
    double V1=(L-H*tan(Fi-W*(t1-T0)))/t1;
    double V2=(L-H*tan(Fi-W*(t2-T0)))/t2;
    if(abs(V2-V1)<0.0001) return V1;
    double t0=(t2+t1)/2;
    double delt=t0-0.5*(L*(1+cos(2*(Fi-W*(t0-T0))))/(H*W)-sin(2*(Fi-W*(t0-T0)))/W);
    if(delt<0) return FindVelocity(t1,t0);
    if(delt>0) return FindVelocity(t0,t2);
    if(delt==0) return (H*W)/pow(cos(Fi-W*(t0-T0)),2);
}

#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;
#define x first
#define y second
typedef double dbl;

typedef pair <dbl, dbl> pnt;

pnt operator - (pnt a, pnt b) {
  return pnt (a.x - b.x, a.y - b.y);
}

pnt st, dir;
dbl _w, _s, _len;

inline dbl f(dbl t) {
  dbl x = st.x + dir.x * t,
      y = st.y + dir.y * t;
  dbl r = atan2 (x, y) - _s;
  while (r < 0) {
    r += 2 * M_PI;
  }
  while (r > 2 * M_PI) {
    r -= 2 * M_PI;
  }
//  fprintf (stderr,  "%lf : %lf (%lf %lf)\n", _len * t * _w, max(r, 2 * M_PI - r), x, y);
  return _len * t * _w / min(r, 2 * M_PI - r);
}

dbl get (pnt a, pnt b, dbl s, dbl w) {
  st = a;
  dir = b - a;
  _s = s;
  _w = w;
  _len = hypot (dir.x, dir.y);

  dbl res = 0;
  for (int i = 0; i <= 200; i++) {
    dbl t = f (i / 200.);
    if (t > res) {
      res = t;
    }
  }
  return res;
}

void read (pnt &p) {
  double x, y;
  scanf ("%lf%lf", &x, &y);
  p.x = x;
  p.y = y;
}

int main (void) {
  pnt a, b;
  read(a);
  read(b);

  int n;
  scanf ("%d", &n);

  vector <dbl> v(1, 0);
  for (int i = 0; i < n; i++) {
    pnt p;
    read(p);
    double s, w;
    scanf("%lf%lf", &s, &w);
    v.push_back(get(a - p, b - p, s, w));
  }

  sort (v.begin(), v.end());
  reverse (v.begin(), v.end());
  int k;
  scanf ("%d", &k);
  printf ("%.20lf\n", v[k]);

  return 0;
}

#include <stdio.h>
#include <tchar.h>
#include<cmath>
#include<valarray>
#include<algorithm>
#include<functional>
#include<list>
#include<vector>
#include<map>
#include<iostream>

using namespace std;

typedef pair<double,double> Para;

int N;
int K;
Para A;
Para B;
const double pi=3.141592653589;

valarray<double> tanks;

double rad(Para p1, Para p2);
double cosinus(Para,Para,Para);
Para ortohonal(Para p);

void Init();
double MakeSolution();

int _tmain(int argc, _TCHAR* argv[])
{
    //::freopen("stdin.txt","r",stdin);
    Init();
    double V=MakeSolution();
    printf("%.4lf\n",V);
    return 0;
}

void Init()
{
    double v1,v2,v3,x,y,alfa,w;
    cin>>x>>y; A=make_pair(x,y);
    cin>>x>>y; B=make_pair(x,y);
    cin>>N;
    tanks.resize(N);
    double D=sqrt(pow(B.first-A.first,2)+pow(B.second-A.second,2));
    Para p;
    for(int i=0;i<N;i++)
    {
        cin>>p.first>>p.second;
        cin>>alfa>>w;
        double a1=rad(p,A);
        a1=abs(alfa-a1);
        double a2=rad(p,B);
        a2=abs(alfa-a2);
        a1=min(a1,2*pi-a1);
        a2=min(a2,2*pi-a2);
        v1=(D*w)/a2;
        Para M=ortohonal(p);
        double t1=a1/w;
        double c=cosinus(M,p,A);
        double t2=acos(c)/w;
        t2+=t1;
        double c1=pow(cos(t1*w),2);
        double c2=pow(cos(t2*w),2);
        double l=sqrt(pow(M.second-p.second,2)+pow(M.first-p.first,2));
        v2=l*w*(c2-c1)/((c1*c2)*t2);
        double j=acos(cosinus(A,p,B));
        v3=D/(t1+(j)/w);
        tanks[i]=max(v1,max(v2,v3));
    }
    sort(&tanks[0],&tanks[N],std::greater<double>());
    cin>>K;
}

double MakeSolution()
{
    if(K==N) return 0;
    for(int i=K;i>0;i--)
    {
        if(tanks[i]!=tanks[i-1]) return tanks[i];
    }
    return tanks[0];
}

double rad(Para p1, Para p2)
{
        double x=(p2.second-p1.second)/(p2.first-p1.first);
        double q=atan(abs(x));
        x=(x<0)? pi-q:q;
        double h=p2.second-p1.second;
        if(h<0) return pi+x;
        if(h==0)return (p2.first>p1.first)?0:pi;
        return x;
}

double cosinus(Para p1,Para p0,Para p2)
{
    double d1=sqrt(pow(p1.first-p0.first,2)+pow(p1.second-p0.second,2));
    double d2=sqrt(pow(p2.first-p0.first,2)+pow(p2.second-p0.second,2));
    double t=((p1.first-p0.first)*(p2.first-p0.first)+(p1.second-p0.second)*(p2.second-p0.second))/(d1*d2);
    return t;
}

Para ortohonal(Para p)
{
    double k=(B.second-A.second)/(B.first-A.first);
    if(k==0) return Para(p.first,A.second);
    Para Z((p.first+A.first)/2+(p.second-A.second)/2*k,0);
    Z.second=k*Z.first+A.second-k*A.first;
    return Z;
}

#include <cstdio>
#include <numeric>
#include <iostream>
#include <vector>
#include <set>
#include <cstring>
#include <string>
#include <map>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <queue>
#include <sstream>
#include <deque>

using namespace std;

#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i = 0; i < (n); i++)
#define re return
#define fi first
#define se second
#define sz(x) ((int) (x).size())
#define all(x) (x).begin(), (x).end()
#define sqr(x) ((x) * (x))
#define sqrt(x) sqrt(abs(x))
#define y0 y3487465
#define y1 y8687969
#define fill(x,y) memset(x,y,sizeof(x))

typedef vector<int> vi;
typedef long long ll;
typedef long double ld;
typedef double D;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
typedef vector<vi> vvi;

template<class T> T abs(T x) { re x > 0 ? x : -x; }

const double pi = 2 * asin (1.0);

int n;
int m;
double x[10000], y[10000], a[10000], w[10000];
double ax, ay, bx, by;

double dist (double x1, double y1, double x2, double y2) {
    re sqrt (sqr (x2 - x1) + sqr (y2 - y1));
}

double get (int i, double x, double y) {
    double b = atan2 (y - ::y[i], x - ::x[i]);
    re min (abs (a[i] - b), 2 * pi - abs (a[i] - b)) / w[i];
}

double cross (double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) {
    double a = x2 - x1;
    double b = x3 - x4;
    double c = x3 - x1;
    double d = y2 - y1;
    double e = y3 - y4;
    double f = y3 - y1;
    re (c * e - b * f) / (a * e - b * d);
}

int calc (double v) {
    int tmp = 0;
    double d = dist (ax, ay, bx, by);
    double dx = (bx - ax);
    double dy = (by - ay);
    double t = d / v;
    for (int i = 0; i < n; i++)
        if (get (i, bx, by) < t) tmp++; else {
            double l = 0, r = max (0.0, min (1.0, cross (ax, ay, bx, by, x[i], y[i], x[i] + (by - ay), y[i] + (ax - bx))));
            for (int it = 0; it < 200; it++) {
                double s1 = (2 * l + r) / 3;
                double s2 = (l + 2 * r) / 3;
                double d1 = get (i, ax + dx * s1, ay + dy * s1) - d * s1 / v;
                double d2 = get (i, ax + dx * s2, ay + dy * s2) - d * s2 / v;
                if (d1 < d2) r = s2; else l = s1;
            }
            double ss = (l + r) / 2;
            double dd = get (i, ax + dx * ss, ay + dy * ss) - d * ss / v;
            if (dd < 0) tmp++;
        }
    re tmp;
}

int main () {
    cin >> ax >> ay >> bx >> by >> n;
    for (int i = 0; i < n; i++)
        cin >> x[i] >> y[i] >> a[i] >> w[i];
    cin >> m;
    double l = 0, r = 1e18;
    for (int it = 0; it < 100; it++) {
        double s = (l + r) / 2;
        if (calc (s) <= m) r = s; else l = s;
    }
    printf ("%.10f\n", r);
    return 0;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
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)
       theta+=2*pi;
    while(theta>pi)
       theta-=2*pi;
}
bool check(double v)
{
    int i,j,s,p,q,nk=0;
    double now_t,theta,T,dist=sqrt((st.x-en.x)*(st.x-en.x)+(st.y-en.y)*(st.y-en.y));
    double ltheta,rtheta,dtheta;
    bool ft;
    T=dist/v;
//  printf("n")
    for(i=0;i<n;i++)
    {
    	double ds=((tank[i].x-st.x)*(en.y-st.y)-(tank[i].y-st.y)*(en.x-st.x));
    	if(fabs(ds)<eps)
    	{
	    	bool fk=false;
	    	if(tank[i].x<=max(st.x,en.x)+eps&&tank[i].x>=min(st.x,en.x)-eps&&tank[i].y<=max(st.y,en.y)+eps&&tank[i].y>=min(st.y,en.y)-eps)
	    	    fk=true;
	        if(fk)
	        {
	           nk++;
	           continue;
			}
		}
        theta=atan2(en.y-tank[i].y,en.x-tank[i].x);
        rtheta=theta;
        ltheta=atan2(st.y-tank[i].y,st.x-tank[i].x);
        if(ltheta>rtheta)
            dtheta=rtheta+2*pi-ltheta;
        else
            dtheta=rtheta-ltheta;
        ft=false;
        if(dtheta>pi)
            swap(ltheta,rtheta);
        if(ltheta<rtheta+eps)
        {
	       if(tank[i].a<rtheta+eps&&tank[i].a>ltheta-eps)
		  	    ft=true;
        }
        else
        {
        	if(tank[i].a<rtheta+eps||tank[i].a>ltheta-eps)
        	    ft=true;
        }
		if(tank[i].w==0)
		{
			if(ft)
			  nk++;
            continue;
		}
		else
        {
            if(theta<tank[i].a-1e-9)
               theta+=2*pi-tank[i].a;
            else
               theta-=tank[i].a;
            now_t=theta/tank[i].w;
            if(!ft&&now_t<T+eps)
               nk++;
            if(ft&&now_t>T-eps)
               nk++;
        }
        if(nk>k)
           return false;
    }
    return true;
}
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;
}

#include <bits/stdc++.h>
using namespace std;
#define M 100010
#define ep 1e-9

const double pi = acos(-1);

struct pnt {
	double x, y;
	pnt (double x = 0, double y = 0) : x(x), y(y) {}
	pnt operator +(pnt a) {return pnt(x + a.x, y + a.y);}
	pnt operator -(pnt a) {return pnt(x - a.x, y - a.y);}
	pnt operator /(double a) {return pnt(x / a, y / a);}
	pnt operator *(double a) {return pnt(x * a, y * a);}
	double operator ^ (pnt a) {return x * a.y - y * a.x;}
	double operator & (pnt a) {return x * a.x + y * a.y;}
	double dist() {return sqrt(x * x + y * y);}
	void input() {scanf("%lf %lf", &x, &y);}
	void print() {printf("%lf %lf\n", x, y);}
} pos, A, B;

double al[M];
double a, w;
int n;

double angle(pnt b, pnt a, pnt c) {
	return acos((b - a & c - a) / (c - a).dist() / (b - a).dist());
}

int main() {
	//freopen("F.in", "r", stdin);
	A.input(), B.input();
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		pos.input(), scanf("%lf %lf", &a, &w);
		pnt tp = pnt(cos(a), sin(a));
		double ang = angle(pos + tp, pos, B);
		double t1 = ang / w;
 		if (angle(pos, A, B) < pi / 2 - ep) {
			double t2 = fabs(pi / 2 - asin(((B - A) ^ tp) / (A - B).dist())) / w;
			double d = (pos  - A & B - A) / (B - A).dist();
			if (t2 / d < t1 / (A - B).dist()) t1 = t2;
		}
		al[i] = t1;
	}
	int k;
	scanf("%d", &k);
	if (k == n) printf("%.12lf\n", 0.);
	else {
		printf("%.12lf\n", (A - B).dist() / al[k] + ep);
	}
}

#pragma comment(linker, "/STACK:60777216")

#include <algorithm>
#include <iostream>
#include <complex>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <ctime>
#include <queue>
#include <cmath>
#include <map>
#include <set>

using namespace std;

#define sz(a)                   int(a.size())
#define all(a)                  (a).begin(), (a).end()
#define CL(a, b)                memset(a, b, sizeof a)
#define FOR(i, a, b)			for (int i(a); i < (b); ++i)
#define REP(i, n)               FOR(i, 0, n)
#define UN(a)                   sort(all(a)), (a).erase(unique(all(a)), (a).end())
#define pb                      push_back
#define SORT(a)                 sort(all(a))

typedef long long ll;
typedef vector <int> vi;
typedef pair <int, int> pii;

double xa,ya,xb,yb;
int n;
double x[11111],y[11111],a[11111],w[11111];
int k;

const double pi = acos(-1.);

bool check(double v,double a,double w){
	int num = 55;
	REP(i,num+1){
		//if(!i) continue;
		double x = xa + (xb-xa)*i/double(num);
		double y = ya + (yb-ya)*i/double(num);
		double q = atan2(y,x) - a;

		if(q>2*pi) q-=2*pi;
		while(q<0) q+=2*pi;
		if(q>2*pi-q) q = 2*pi - q;

		//if(q<0)
	//		cout<<q<<endl;
	//	while(q<0);

		if(hypot(x-xa,y-ya)/v >=  (w < 1e-5 ? (i==0 ? 0 : 1e10) : q/w)) return 1;
	}

	return 0;
}

bool good(double s){
	int num = 0;
	REP(i,n){
		xa-=x[i],ya-=y[i],xb-=x[i],yb-=y[i];

		if(check(s,a[i],w[i]))
			num ++;

		xa+=x[i],ya+=y[i],xb+=x[i],yb+=y[i];

		if(num>k) return 0;
		if(num + n-i<=k) return 1;
	}
	return num <= k;
}

int main() {
#ifdef LocalHost
	freopen("input.txt", "r", stdin);
#endif

	cin>>xa>>ya>>xb>>yb>>n;
	REP(i,n) scanf("%lf %lf %lf %lf",x+i,y+i,a+i,w+i);
	cin>>k;

	double a = 0, b = 1e5, best = 1e5;
	REP(i,33){
		double s = (a+b)/2;
		if(good(s))
			best = s, b = s;
		else a = s;
	}
	printf("%.4lf\n",best);

	return 0;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
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)
       theta+=2*pi;
    while(theta>pi)
       theta-=2*pi;
}
bool check(double v)
{
    int i,j,s,p,q,nk=0;
    double now_t,theta,T,dist=sqrt((st.x-en.x)*(st.x-en.x)+(st.y-en.y)*(st.y-en.y));
    double ltheta,rtheta,dtheta,low,high,mid,mt,vs,fs;
    bool ft;
    T=dist/v;
//  printf("n")
    for(i=0;i<n;i++)
    {
    	double ds=((tank[i].x-st.x)*(en.y-st.y)-(tank[i].y-st.y)*(en.x-st.x));
    	if(fabs(ds)<eps)
    	{
	    	bool fk=false;
	    	if(tank[i].x<=max(st.x,en.x)+eps&&tank[i].x>=min(st.x,en.x)-eps&&tank[i].y<=max(st.y,en.y)+eps&&tank[i].y>=min(st.y,en.y)-eps)
	    	    fk=true;
	        if(fk)
	        {
	           nk++;
	           continue;
			}
		}
        theta=atan2(en.y-tank[i].y,en.x-tank[i].x);
        rtheta=theta;
        ltheta=atan2(st.y-tank[i].y,st.x-tank[i].x);
        if(ltheta>rtheta)
            dtheta=rtheta+2*pi-ltheta;
        else
            dtheta=rtheta-ltheta;
        ft=false;
        if(dtheta>pi)
            swap(ltheta,rtheta);
        if(ltheta<rtheta+eps)
        {
	       if(tank[i].a<rtheta+eps&&tank[i].a>ltheta-eps)
		  	    ft=true;
        }
        else
        {
        	if(tank[i].a<rtheta+eps||tank[i].a>ltheta-eps)
        	    ft=true;
        }
		if(tank[i].w==0)
		{
			if(ft)
			  nk++;
            continue;
		}
		else
        {
            if(theta<tank[i].a-1e-9)
               theta+=2*pi-tank[i].a;
            else
               theta-=tank[i].a;
            now_t=theta/tank[i].w;
            if(!ft&&now_t<T+eps)
            {
               nk++;
               continue;
			}
			if(ft&&now_t>T-eps)
			{
               nk++;
			   continue;
			}
			while(ltheta<tank[i].a-eps)
			   ltheta+=2*pi;
	        while(rtheta<tank[i].a-eps)
               rtheta+=2*pi;
			if(ltheta<rtheta)
			{
				low=(ltheta-tank[i].a)/tank[i].w;
				high=(rtheta-tank[i].a)/tank[i].w;
			    mt=low;
				fs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
				theta=atan2(en.y-st.y,en.x-st.x);
				while(low<high-eps)
				{
					mid=(low+high)/2.0;
					double vs,mt=mid;
					vs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
				    if((vs>eps&&fs>eps)||(vs<eps&&fs<eps))
				        low=mid+eps;
                    else
                        high=mid;
				}
				mt=0.5*(low+high);
				vs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
				if(fabs(vs)<1e-4)
				{
					nk++;
					continue;
				}
			}
			else
			{
				low=0;
				high=(rtheta-tank[i].a)/tank[i].w;
				double mt=low,fs;
				fs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
				theta=atan2(en.y-st.y,en.x-st.x);
				while(low<high-eps)
				{
					mid=(low+high)/2.0;
					double vs,mt=mid;
					vs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
				    if((vs>eps&&fs>eps)||(vs<eps&&fs<eps))
				        low=mid+eps;
                    else
                        high=mid;
				}
				mt=0.5*(low+high);
				vs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
				if(fabs(vs)<1e-4)
				{
					nk++;
					continue;
				}
				low=(ltheta-tank[i].a)/tank[i].w;
				high=2*pi/tank[i].w;
				mt=low;
				fs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
				theta=atan2(en.y-st.y,en.x-st.x);
				while(low<high-eps)
				{
					mid=(low+high)/2.0;
					double vs,mt=mid;
					vs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
				    if((vs>eps&&fs>eps)||(vs<eps&&fs<eps))
				        low=mid+eps;
                    else
                        high=mid;
				}
				mt=0.5*(low+high);
				vs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
				if(fabs(vs)<1e-4)
				{
					nk++;
					continue;
				}
			}
		}
        if(nk>k)
           return false;
    }
    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;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
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);
		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<50;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);
    for(int it=0;it<50;it++)
    {
        mid=(low+high)*0.5;
        if(check(mid))
           high=mid;
        else
           low=mid;
    }
    printf("%.20f\n",(low+high)*0.5);
    return 0;
}

#include<iostream>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<cassert>
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;
    double ltheta,rtheta,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++)
    {
    //	if(v==782)
    	  // printf("i=%d,nk=%d\n",i,nk);
    	double ds=((tank[i].x-st.x)*(en.y-st.y)-(tank[i].y-st.y)*(en.x-st.x));
    	if(fabs(ds)<eps)
    	{
	    	bool fk=false;
	    	if(tank[i].x<=max(st.x,en.x)+eps&&tank[i].x>=min(st.x,en.x)-eps&&tank[i].y<=max(st.y,en.y)+eps&&tank[i].y>=min(st.y,en.y)-eps)
	    	    fk=true;
	        if(fk)
	        {
	           nk++;
	           continue;
			}
		}
        theta=atan2(en.y-tank[i].y,en.x-tank[i].x);
        rtheta=theta;
        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);
        if(ltheta<0)
           ltheta=-ltheta;
        if(rtheta<0)
           rtheta=-rtheta;
        if(ltheta>rtheta)
            swap(ltheta,rtheta);
		if(tank[i].w==0)
            continue;
		else
        {
			while(ltheta<tank[i].a-eps)
			   ltheta+=2*pi;
             ltheta-=tank[i].a;
             if(ltheta>pi)
               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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
    			mt=high;
    			bs=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
	    		    my=mt=(low+2*high)/3.;
	    		    fy=(st.x+v*cos(theta)*mt-tank[i].x)*sin(tank[i].a+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].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+tank[i].w*mt)-(st.y+v*sin(theta)*mt-tank[i].y)*cos(tank[i].a+tank[i].w*mt);
		    	if((fs>0&&fx<eps)||(fs<0&&fx>-eps))
		    	{
			    	nk++;
			    	continue;
		    	}
		}
        if(nk>k)
           return false;
    }
    return nk<=k;
}
int main()
{
    int i,j,s,p,q;
    double low,high,mid;
   // st.x=rand()%100;
   // st.y=rand()%100;
   // en.x=rand()%100;
   // en.y=rand()%100;
	scanf("%lf%lf%lf%lf",&st.x,&st.y,&en.x,&en.y);
    //n=5;
	scanf("%d",&n);
    for(i=0;i<n;i++)
    {
    //	tank[i].x=rand();
    //	tank[i].y=rand();
    //	tank[i].a=rand();
    //	tank[i].w=rand()%100;
       scanf("%lf%lf%lf%lf",&tank[i].x,&tank[i].y,&tank[i].a,&tank[i].w);
       norm(tank[i].a);
    }
   // k=rand()%(n+1);
   // printf("%d\n",n);
//	printf("%.0f %.0f %.0f %.0f\n",st.x,st.y,en.x,en.y);
   // //for(i=0;i<n;i++)
    //   printf("%.0f %.0f %.0f %.0f\n",tank[i].x,tank[i].y,tank[i].a,tank[i].w);
  //  printf("%d\n",k);
    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;
}
/*
41 67 34 0
5
19169 15724 -1 58
26962 24464 -0 45
23281 16827 2 91
2995 11942 2 36
32391 14604 0 53
4
*/

#include <bits/stdc++.h>
using namespace std;
#define M 100010
#define ep 1e-9

const double pi = acos(-1);

struct pnt {
	double x, y;
	pnt (double x = 0, double y = 0) : x(x), y(y) {}
	pnt operator +(pnt a) {return pnt(x + a.x, y + a.y);}
	pnt operator -(pnt a) {return pnt(x - a.x, y - a.y);}
	pnt operator /(double a) {return pnt(x / a, y / a);}
	pnt operator *(double a) {return pnt(x * a, y * a);}
	double operator ^ (pnt a) {return x * a.y - y * a.x;}
	double operator & (pnt a) {return x * a.x + y * a.y;}
	double dist() {return sqrt(x * x + y * y);}
	void input() {scanf("%lf %lf", &x, &y);}
	void print() {printf("%lf %lf\n", x, y);}
} pos, A, B;

double al[M];
double a, w;
int n;

double angle(pnt b, pnt a, pnt c) {
	return acos((b - a & c - a) / (c - a).dist() / (b - a).dist());
}

int main() {
	//freopen("F.in", "r", stdin);
	A.input(), B.input();
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		pos.input(), scanf("%lf %lf", &a, &w);
		pnt tp = pnt(cos(a), sin(a));
		double ang = angle(pos + tp, pos, B);
		double t1 = ang / w;
		/*
 		if (angle(pos, A, B) < pi / 2 - ep) {
			double t2 = fabs(pi / 2 - asin(((B - A) ^ tp) / (A - B).dist())) / w;
			double d = (pos  - A & B - A) / (B - A).dist();
			if (t2 / d < t1 / (A - B).dist()) t1 = t2;
		}
		*/
		al[i] = t1;
	}
	int k;
	scanf("%d", &k);
	if (k == n) printf("%.12lf\n", 0.);
	else {
		printf("%.12lf\n", (A - B).dist() / al[k] + ep);
	}
}