#include <bits/stdc++.h>
using namespace std;
int const N = 100000, inf = 1e9 + 100;
pair<int, int> x[N], z[N];
pair<long long, long long> an;
int n, y[N];
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
bool go(int m) {
  int j = 0;
  long long s = 0;
  for (int i = 0; i < (int)(n); ++i)
    if (!(z[i].first > z[i].second && i >= m)) {
      s += z[i].first;
      y[j++] = z[i].second;
    }
  sort(y, y + j);
  --j;
  while (j >= 0) {
    if (s > y[j]) {
      s -= y[j];
      --j;
      continue;
    }
    an.first = (long long)j * y[j] + (y[j] - s);
    an.second = (long long)n * y[j];
    return m == n || z[m].first >= y[j];
  }
  an = make_pair(0, 1);
  return true;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < (int)(n); ++i) scanf("%d%d", &x[i].second, &x[i].first);
  sort(x, x + n);
  for (int i = 0; i < (int)(n); ++i) z[i] = make_pair(x[i].second, x[i].first);
  sort(z, z + n);
  int l = 0, r = n;
  while (r > l) {
    int m = l + r >> 1;
    if (go(m))
      r = m;
    else
      l = m + 1;
  }
  double a, b;
  go(l);
  if (l) {
    a = (double)an.first / an.second;
    go(l - 1);
    b = (double)an.first / an.second;
    if (a > b) go(l);
  }
  long long g = gcd(an.first, an.second);
  an.first /= g;
  an.second /= g;
  printf("%lld %lld\n", an.first, an.second);
}
