#include <bits/stdc++.h>
using namespace std;
struct PQ {
  priority_queue<long long> d;
  priority_queue<long long, vector<long long>, greater<long long>> u;
  long long ds, dn;
  PQ(void) { ds = 0, dn = 0; }
  void psd(long long x) {
    d.push(x);
    ds += x;
    dn++;
  }
  long long ppd(void) {
    long long res = d.top();
    ds -= res;
    dn--;
    d.pop();
    return res;
  }
  void psu(long long x) { u.push(x); }
  long long ppu(void) {
    long long res = u.top();
    u.pop();
    return res;
  }
};
long long gcd(long long x, long long y) {
  if (x < y) swap(x, y);
  if (y == 0) return 1;
  if (x % y == 0) return y;
  return gcd(y, x % y);
}
long long n, s, ansx, ansy = 1;
pair<long long, long long> x[100005];
PQ pq;
int main(void) {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i].second >> x[i].first;
  sort(x, x + n);
  for (int i = 0; i < n; i++) s += max(0LL, x[i].first - x[i].second);
  for (int i = 0; i < n; i++) {
    while (!pq.u.empty() && pq.ds + pq.u.top() <= s) pq.psd(pq.ppu());
    long long nx = 0, ny = 1;
    if (pq.ds <= s) {
      if (pq.ds + x[i].second <= s - max(0LL, x[i].first - x[i].second))
        nx = pq.dn + 1, ny = 1;
      else if (x[i].first - x[i].second > 0)
        ny = x[i].first, nx = pq.dn * ny + s - pq.ds;
      else
        ny = x[i].second, nx = pq.dn * ny + s - pq.ds;
    }
    if (ansx * ny < ansy * nx) ansx = nx, ansy = ny;
    s -= max(0LL, x[i].first - x[i].second);
    pq.psd(x[i].second);
    pq.psu(pq.ppd());
  }
  ansy *= n;
  long long g = gcd(ansx, ansy);
  if (ansx == 0) ansy = 1;
  cout << ansx / g << ' ' << ansy / g << endl;
}
