Problem: Recently the construction of Berland collider has been completed. Collider can be represented as a long narrow tunnel that contains n particles. We associate with collider 1-dimensional coordinate system, going from left to right. For each particle we know its coordinate and velocity at the moment of start of the collider. The velocities of the particles don't change after the launch of the collider. Berland scientists think that the big bang will happen at the first collision of particles, whose velocities differs in directions. Help them to determine how much time elapses after the launch of the collider before the big bang happens.

Input

The first line contains single integer n (1 ≤ n ≤ 5·105) — amount of particles in the collider. Next n lines contain description of particles. Each particle is described by two integers xi, vi ( - 109 ≤ xi, vi ≤ 109, vi ≠ 0) — coordinate and velocity respectively. All the coordinates are distinct. The particles are listed in order of increasing of coordinates. All the coordinates are in meters, and all the velocities — in meters per second. The negative velocity means that after the start of collider the particle will move to the left, and the positive — that the particle will move to the right.

Output

If there will be no big bang, output -1. Otherwise output one number — how much time in seconds elapses after the launch of the collider before the big bang happens. Your answer must have a relative or absolute error less than 10 - 9.

Examples

Input

3
-5 9
0 1
5 -1


Output

1.00000000000000000000


Input

6
1 3
2 3
3 3
4 -3
5 -1
6 -100


Output

0.02912621359223301065

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;

public class ECollider {

    public static void main(String[] args) {
        MyInputReader s = new MyInputReader(System.in);
        int n = s.nextInt();
        Particle[] parts = new Particle[n];
        for (int i = 0; i < n; i++) {
            int pos = s.nextInt();
            int speed = s.nextInt();
            Particle p = new Particle(pos, speed);
            parts[i] = p;
        }
        double left = 0.0;
        double right = Math.pow(10.0, 18);
        boolean correct = true;
        Arrays.sort(parts);
        for (int i = 0; i < 200; i++) {
            double time = (right + left) / 2.0;
            double mx = Double.NEGATIVE_INFINITY;
            boolean flag = true;
            int j = 0;
            while (flag && j < n) {
                Particle cur = parts[j];
                if (cur.speed >= 0.0) {
                    mx = Math.max(mx, cur.pos + cur.speed * time);
                } else {
                    double nextPos = cur.pos + cur.speed * time;
                    if (nextPos < mx) {
                        flag = false;
                        right = time;
                    }
                }
                j += 1;
            }
            if (flag) {
                if (i == 0) {
                    correct = false;
                    System.out.println("-1");
                    return;
                }
                left = time;
            }
        }
        System.out.println(left);
    }


    static class Particle implements Comparable<Particle> {

        private double speed;
        private double pos;

        public Particle(double position, double speed) {
            this.speed = speed;
            this.pos = position;
        }

        @Override
        public int compareTo(Particle o) {
            return Double.compare(this.pos, o.pos);
        }
    }

    static class MyInputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public MyInputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

}