Vasiliy lives at point (a, b) of the coordinate plane. He is hurrying up to work so he wants to get out of his house as soon as possible. New app suggested n available Beru-taxi nearby. The i-th taxi is located at point (xi, yi) and moves with a speed vi. 

Consider that each of n drivers will move directly to Vasiliy and with a maximum possible speed. Compute the minimum time when Vasiliy will get in any of Beru-taxi cars.

Input

The first line of the input contains two integers a and b ( - 100 ≤ a, b ≤ 100) — coordinates of Vasiliy's home.

The second line contains a single integer n (1 ≤ n ≤ 1000) — the number of available Beru-taxi cars nearby. 

The i-th of the following n lines contains three integers xi, yi and vi ( - 100 ≤ xi, yi ≤ 100, 1 ≤ vi ≤ 100) — the coordinates of the i-th car and its speed.

It's allowed that several cars are located at the same point. Also, cars may be located at exactly the same point where Vasiliy lives.

Output

Print a single real value — the minimum time Vasiliy needs to get in any of the Beru-taxi cars. You answer will be considered correct if its absolute or relative error does not exceed 10 - 6. 

Namely: let's assume that your answer is a, and the answer of the jury is b. The checker program will consider your answer correct, if <image>.

Examples

Input

0 0
2
2 0 1
0 2 2


Output

1.00000000000000000000

Input

1 3
3
3 3 2
-2 3 6
-2 7 10


Output

0.50000000000000000000

Note

In the first sample, first taxi will get to Vasiliy in time 2, and second will do this in time 1, therefore 1 is the answer.

In the second sample, cars 2 and 3 will arrive simultaneously.
import java.io.*;
import java.util.*;

public class Main {

    //  Needed Methods

    public static double DistanceBetween2Points(double x1, double y1, double x2, double y2) {
        return Math.sqrt( Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2) );
    }

    //  Needed Classes

    static class Car implements Comparable<Car> {

        long x, y, v;
        double d;

        public Car(long x, long y, long v) {
            this.x = x;
            this.y = y;
            this.v = v;
        }

        Car SetDistance(long x, long y) {
            d = DistanceBetween2Points(this.x, this.y, x, y);
            return this;
        }

        @Override
        public int compareTo(Car c) {
            return Double.compare( ( d / (double) v) , ( c.d / (double) c.v) );
        }
    }

    //  Solving Method

    public static void Solve() {

        long a = cin.nextLong(), b = cin.nextLong(), n = cin.nextLong();

        PriorityQueue<Car> cars = new PriorityQueue<>();

        for (int i = 0; i < n; i++) {
            cars.add(new Car(cin.nextLong(), cin.nextLong(), cin.nextLong()).SetDistance(a, b));
        }

        sb.append( Round( cars.peek().d / (double) cars.peek().v , 6) );
    }

































    public static void main(String[] args) {

        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        cin = new Input(inputStream);
        cout = new Output(outputStream);
        sb = new StringBuilder();

        Solve();

        cout.println(sb.toString().trim());
        cout.close();
    }

    public static double Round(double valueToRound, int numberOfDecimalPlaces)
    {
        double multipicationFactor = Math.pow(10, numberOfDecimalPlaces);
        double interestedInZeroDPs = valueToRound * multipicationFactor;
        return Math.round(interestedInZeroDPs) / multipicationFactor;
    }

    static class Output {
        private final PrintWriter writer;

        Output(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public Output(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        void close() {
            writer.close();
        }

        void println(Object i) {
            writer.println(i);
        }
        void print(Object i) {
            writer.print(i);
        }
    }

    static class Input {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private Input.SpaceCharFilter filter;

        Input(InputStream stream) {
            this.stream = stream;
        }

        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++];
        }

        String nextString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                if (Character.isValidCodePoint(c)) {
                    res.appendCodePoint(c);
                }
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        int nextInt() {
            return Integer.parseInt(this.next());
        }

        long nextLong() {
            return Long.parseLong(this.next());
        }

        boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

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

        String next() {
            return nextString();
        }

        public interface SpaceCharFilter {
            boolean isSpaceChar(int ch);

        }

    }

    private static Input cin;
    private static Output cout;
    private static StringBuilder sb;
}