#include <bits/stdc++.h>
using namespace std;
namespace mine {
long long qread() {
  long long ans = 0, f = 1;
  char c = getchar();
  while (c < '0' or c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while ('0' <= c and c <= '9') ans = ans * 10 + c - '0', c = getchar();
  return ans * f;
}
void write(long long num) {
  if (num < 0) putchar('-'), num = -num;
  if (num >= 10) write(num / 10);
  putchar('0' + num % 10);
}
void write1(long long num) {
  write(num);
  putchar(' ');
}
void write2(long long num) {
  write(num);
  putchar('\n');
}
template <typename T>
void chmax(T &x, const T y) {
  x = (x > y ? x : y);
}
template <typename T>
void chmin(T &x, const T y) {
  x = (x < y ? x : y);
}
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
int mm(const int x) { return x >= MOD ? x - MOD : x; }
template <typename T>
void add(T &x, const int &y) {
  x = (x + y >= MOD ? x + y - MOD : x + y);
}
long long qpower(long long x, long long e, int mod = MOD) {
  long long ans = 1;
  (e >= 0);
  while (e) {
    if (e & 1) ans = ans * x % mod;
    x = x * x % mod;
    e >>= 1;
  }
  return ans;
}
long long invm(long long x) { return qpower(x, MOD - 2); }
const int N = 1e5 + 10;
pair<int, int> a[N];
bool cmp(pair<int, int> x, pair<int, int> y) {
  return max(x.first, x.second) > max(y.first, y.second);
}
long long sum[N];
void main() {
  int n = qread();
  for (int i = (1), I = (n); i <= I; i++)
    a[i].first = qread(), a[i].second = qread();
  sort(a + 1, a + n + 1, cmp);
  long long S = 0;
  for (int i = (1), I = (n); i <= I; i++)
    sum[i] = sum[i - 1] + max(a[i].first, a[i].second), S += a[i].first;
  long long ansx = 0, ansy = 1;
  for (int k = (1), I = (n); k <= I; k++) {
    int fl = 0, fr = n, q = -1;
    while (fl <= fr) {
      int mid = (fl + fr) / 2;
      if (sum[mid] - (k <= mid ? max(a[k].first, a[k].second) : 0) +
              a[k].second >=
          S)
        q = mid, fr = mid - 1;
      else
        fl = mid + 1;
    }
    if (q < 0) continue;
    if (sum[q] - (k <= q ? max(a[k].first, a[k].second) : 0) >= S) continue;
    long long nowx = long long(n - (q - (k <= q))) * a[k].second - S + sum[q] -
                     (k <= q ? max(a[k].first, a[k].second) : 0),
              nowy = 1ll * a[k].second * n;
    long long d = gcd(nowx, nowy);
    nowx /= d, nowy /= d;
    if (nowx * ansy > ansx * nowy) ansx = nowx, ansy = nowy;
  }
  write1(ansx), write(ansy);
}
};  // namespace mine
signed main() {
  srand(time(0));
  mine::main();
}
