0 0 10 10
1
10 0 0 1.57079
0
 -88 -68 -10 -61
5
-64 -55 3.09648 0.28346
-8 -52 2.46781 0.13262
-8 -59 3.02445 0.00119
-40 90 2.37292 0.15686
-29 -34 2.73957 0.18287
0
 0 0 10 10
2
10 0 0 1.57079
10 5 0 0.7854
1
 -100000 -100000 100000 100000
1
100000 0 0 15.70796
0
 -3 -7 -14 2
5
-16 19 2.12587 0.30781
9 -19 3.27418 0.06595
-1 12 0.12414 8.82294
20 10 6.25657 0.77605
-10 17 0.29502 6.31019
5

14.142079
 7.216642
 7.071084
 2828426.5363
 0.0000

import java.util.InputMismatchException;
import java.math.BigInteger;
import java.io.*;

/**
 * @author Egor Kulikov (egor@egork.net)
 * Actual solution is at the bottom
 */
public class Main {
	public static void main(String[] args) {
		InputReader in = new StreamInputReader(System.in);
		PrintWriter out = new PrintWriter(System.out);
		run(in, out);
	}

	public static void run(InputReader in, PrintWriter out) {
		Solver solver = new TaskF();
		solver.solve(1, in, out);
		Exit.exit(in, out);
	}
}

abstract class InputReader {
	private boolean finished = false;

	public abstract int read();

	public int readInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public String readString() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuffer res = new StringBuffer();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	private boolean isSpaceChar(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	public double readDouble() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		double res = 0;
		while (!isSpaceChar(c) && c != '.') {
			if (c == 'e' || c == 'E')
				return res * Math.pow(10, readInt());
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		}
		if (c == '.') {
			c = read();
			double m = 1;
			while (!isSpaceChar(c)) {
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, readInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				m /= 10;
				res += (c - '0') * m;
				c = read();
			}
		}
		return res * sgn;
	}

	public void setFinished(boolean finished) {
		this.finished = finished;
	}

	public abstract void close();

	public void readDoubleArrays(double[]...arrays) {
		for (int i = 0; i < arrays[0].length; i++) {
			for (int j = 0; j < arrays.length; j++)
				arrays[j][i] = readDouble();
		}
	}
}

class Exit {
	private Exit() {
	}

	public static void exit(InputReader in, PrintWriter out) {
		in.setFinished(true);
		in.close();
		out.close();
	}
}

class StreamInputReader extends InputReader {
	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar, numChars;

	public StreamInputReader(InputStream stream) {
		this.stream = stream;
	}

	public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	@Override
	public void close() {
		try {
			stream.close();
		} catch (IOException ignored) {
		}
	}
}

interface Solver {
	public void solve(int testNumber, InputReader in, PrintWriter out);
}

class GeometryUtils {
	public static double fastHypot(double...x) {
		if (x.length == 0)
			return 0;
		else if (x.length == 1)
			return Math.abs(x[0]);
		else {
			double sumSquares = 0;
			for (double value : x)
				sumSquares += value * value;
			return Math.sqrt(sumSquares);
		}
	}

	}

class TaskF implements Solver {
	private double length;

	public void solve(int testNumber, InputReader in, PrintWriter out) {
		double startX = in.readDouble();
		double startY = in.readDouble();
		double finishX = in.readDouble();
		double finishY = in.readDouble();
		int tankCount = in.readInt();
		double[] x = new double[tankCount];
		double[] y = new double[tankCount];
		double[] angle = new double[tankCount];
		double[] speed = new double[tankCount];
		in.readDoubleArrays(x, y, angle, speed);
		int maxHits = in.readInt();
		if (maxHits == tankCount) {
			out.println(0);
			return;
		}
		double left = 0;
		length = GeometryUtils.fastHypot(startX - finishX, startY - finishY);
		double right = length * 10;
		for (int it = 0; it < 60; it++) {
			double currentSpeed = (left + right) / 2;
			int hitCount = 0;
			for (int i = 0; i < tankCount && hitCount <= maxHits && tankCount - i + hitCount > maxHits; i++) {
				if (canHit(startX, startY, finishX, finishY, currentSpeed, x[i], y[i], angle[i], speed[i]))
					hitCount++;
			}
			if (hitCount <= maxHits)
				right = currentSpeed;
			else
				left = currentSpeed;
		}
		out.printf("%.5f\n", (left + right) / 2);
	}

	private boolean canHit(double startX, double startY, double finishX, double finishY, double currentSpeed, double x, double y, double angle, double speed) {
		double left = 0;
		double right = length / currentSpeed;
		for (int it = 0; it < 100; it++) {
			double left1 = (2 * left + right) / 3;
			double right1 = (2 * right + left) / 3;
			double time1 = evaluate(left1, startX, startY, finishX, finishY, currentSpeed, x, y, angle, speed);
			double time2 = evaluate(left1, startX, startY, finishX, finishY, currentSpeed, x, y, angle, speed);
			if (time1 < 0 || time2 < 0)
				return true;
			if (time1 < time2)
				right = right1;
			else
				left = left1;
		}
		return false;
	}

	private double evaluate(double time, double startX, double startY, double finishX, double finishY, double currentSpeed, double x, double y, double angle, double speed) {
		double tankX = startX + (finishX - startX) / length * time * currentSpeed;
		double tankY = startY + (finishY - startY) / length * time * currentSpeed;
		double diffAngle = Math.abs(angle - Math.atan2(tankY - y, tankX - x));
		if (diffAngle > 2 * Math.PI)
			diffAngle -= 2 * Math.PI;
		diffAngle = Math.min(diffAngle, 2 * Math.PI - diffAngle);
		return diffAngle / speed - time;
	}

}

