#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXN = 100000;
struct Beam {
  int a, b;
  int key;
};
bool operator<(const Beam &x, const Beam &y) { return x.key < y.key; }
struct Frac {
  long long num, den;
  Frac() {}
  Frac(long long _num, long long _den) {
    num = _num, den = _den;
    long long g = gcd(num, den);
    num /= g;
    den /= g;
  }
};
int n;
Beam beam[MAXN];
bool isslow[MAXN];
pair<int, int> slow[MAXN];
int nslow;
bool used[MAXN];
bool better(const Frac &a, const Frac &b) {
  long long awhole = a.num / a.den, bwhole = b.num / b.den;
  if (awhole != bwhole) return awhole > bwhole;
  long long arem = a.num % a.den, brem = b.num % b.den;
  return arem * b.den > brem * a.den;
}
Frac solve() {
  for (int i = (0); i < (n); ++i) beam[i].key = beam[i].b;
  sort(beam, beam + n);
  for (int i = (0); i < (n); ++i) isslow[i] = beam[i].a > beam[i].b;
  nslow = 0;
  for (int i = (0); i < (n); ++i)
    if (isslow[i]) slow[nslow++] = make_pair(beam[i].a, i);
  sort(slow, slow + nslow);
  int cntleft = 0;
  for (int i = (0); i < (n); ++i) used[i] = false;
  long long asum = 0;
  for (int i = (0); i < (n); ++i)
    if (!isslow[i]) asum += beam[i].a, used[i] = true, ++cntleft;
  int at = 0;
  vector<Frac> opt;
  long long bsum = 0;
  for (int i = n - 1; i >= 0; --i) {
    if (isslow[i]) {
      if (used[i]) {
        asum -= beam[i].a, used[i] = false, --cntleft;
      }
      continue;
    }
    --cntleft;
    while (bsum + beam[i].b >= asum) {
      long long cnum = min((long long)beam[i].b, beam[i].b - (asum - bsum)),
                cden = beam[i].b;
      opt.push_back(Frac((long long)cntleft * cden + cnum, (long long)cden));
      while (at < nslow && slow[at].second >= i) ++at;
      if (at >= nslow) break;
      int idx = slow[at].second;
      used[idx] = true;
      asum += beam[idx].a;
      ++cntleft;
      ++at;
    }
    bsum += beam[i].b;
  }
  Frac ret(0, 1);
  for (int i = (0); i < (((int)(opt).size())); ++i)
    if (better(opt[i], ret)) ret = opt[i];
  return Frac(ret.num, ret.den * n);
}
void run() {
  scanf("%d", &n);
  for (int i = (0); i < (n); ++i) scanf("%d%d", &beam[i].a, &beam[i].b);
  Frac ans = solve();
  printf("%lld %lld\n", ans.num, ans.den);
}
int main() {
  run();
  return 0;
}
