#include <bits/stdc++.h>
using namespace std;
bool sortt(pair<int, int>& A, pair<int, int>& B) {
  if (A.first > B.first) {
    return false;
  }
  return true;
}
int main() {
  int N, mini = INT_MAX;
  scanf("%d", &N);
  vector<pair<int, int> > PARES(N);
  for (int I = 0; I < N; I++) {
    scanf("%d%d", &PARES[I].first, &PARES[I].second);
    if (mini > PARES[I].first) {
      mini = PARES[I].first;
    }
  }
  for (int I = 0; I < N; I++) {
    PARES[I].first += (-mini);
  }
  sort(PARES.begin(), PARES.end(), sortt);
  double l = 0.0000000000, r = 2.0 * 1000000000.0;
  bool HH;
  bool KK = false;
  for (double m = (l + r) / 2; r - l > 0.0000000001; m = (l + r) / 2) {
    HH = false;
    double maximo = -2000000000.0;
    for (int I = 0; I < N; I++) {
      if (PARES[I].second > 0) {
        if (maximo < (double)PARES[I].second * m + (double)PARES[I].first) {
          maximo = (double)PARES[I].second * m + (double)PARES[I].first;
        }
      } else if (maximo >= 0.0) {
        if (maximo > (double)PARES[I].first + (double)PARES[I].second * m) {
          HH = true;
          KK = true;
          I = N;
        }
      }
    }
    if (!HH)
      l = m;
    else
      r = m;
  }
  if (!KK)
    printf("-1.0000000000\n");
  else
    printf("%.10f\n", l);
  scanf("%d", &N);
  return 0;
}
