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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int i, it, n;
double L, R, C;
int NN[500000];
long x[500000], v[500000];
double LL[500000], RR[500000];
bool inn(long double l1, long double r1, long double l2, long double r2) {
  if (l1 >= l2 && r2 >= l1) return true;
  if (r1 >= l2 && r2 >= r1) return true;
  if (l2 >= l1 && r1 >= l2) return true;
  if (r2 >= l1 && r1 >= r2) return true;
  return false;
}
void Sort(int l, int r) {
  int i, j;
  long double L, R;
  i = l;
  j = r;
  int w = l + rand() % (r - l + 1);
  L = LL[w];
  R = RR[w];
  while (i <= j) {
    while (L > LL[i] || (L == LL[i] && R > RR[i])) ++i;
    while (L < LL[j] || (L == LL[j] && R < RR[j])) --j;
    if (i <= j) {
      swap(LL[i], LL[j]);
      swap(RR[i], RR[j]);
      swap(NN[i], NN[j]);
      i++;
      j--;
    }
  }
  if (l < j) Sort(l, j);
  if (i < r) Sort(i, r);
}
bool check(long double T) {
  int i;
  double l1, r1, l2, r2;
  for (i = 0; i < n; ++i) {
    LL[i] = x[i];
    RR[i] = x[i] + v[i] * T;
    if (LL[i] > RR[i]) swap(LL[i], RR[i]);
    NN[i] = 1;
    if (v[i] < 0) NN[i] = 2;
  }
  l1 = -1e+20;
  r1 = l1;
  l2 = l1;
  r2 = l1;
  for (i = 0; i < n; ++i) {
    if (NN[i] == 1) {
      if (l2 >= LL[i] && l2 <= RR[i]) return true;
      if (r2 >= LL[i] && r2 <= RR[i]) return true;
      if (LL[i] >= l2 && LL[i] <= r2) return true;
      if (RR[i] >= l2 && RR[i] <= r2) return true;
      if (LL[i] > r1) {
        l1 = LL[i];
        r1 = RR[i];
      } else if (RR[i] > r1)
        r1 = RR[i];
    } else if (NN[i] == 2) {
      if (l1 >= LL[i] && l1 <= RR[i]) return true;
      if (r1 >= LL[i] && r1 <= RR[i]) return true;
      if (LL[i] >= l1 && LL[i] <= r1) return true;
      if (RR[i] >= l1 && RR[i] <= r1) return true;
      if (LL[i] > r2) {
        l2 = LL[i];
        r2 = RR[i];
      } else if (RR[i] > r2)
        r2 = RR[i];
    }
  }
  return false;
}
int main() {
  cin >> n;
  for (i = 0; i < n; ++i) {
    cin >> x[i] >> v[i];
  }
  L = 0;
  R = 1e+9;
  for (it = 0; it < 65; ++it) {
    C = (L + R) / 2;
    if (check(C))
      R = C;
    else
      L = C;
  }
  if (!check(R)) {
    cout << -1 << endl;
    exit(0);
  }
  cout.precision(16);
  cout << fixed << R << endl;
}