#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long f = 1, x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int stack[20];
template <typename T>
inline void write(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (!x) {
    putchar('0');
    return;
  }
  int top = 0;
  while (x) stack[++top] = x % 10, x /= 10;
  while (top) putchar(stack[top--] + '0');
}
template <typename T>
inline void pr1(T x) {
  write(x);
  putchar(' ');
}
template <typename T>
inline void pr2(T x) {
  write(x);
  putchar('\n');
}
const int MAXN = 100005;
struct line {
  int A, B, val;
} w[MAXN];
bool cmp(line n1, line n2) { return n1.val > n2.val; }
int n;
long long pre[MAXN], S, mn1[MAXN], mn2[MAXN];
long long getval(int a, int b) { return a < b ? pre[a] : pre[a] - w[b].val; }
long long gcd(long long a, long long b) { return a == 0 ? b : gcd(b % a, a); }
int main() {
  n = read();
  for (int i = 1; i <= n; i++)
    w[i].A = read(), w[i].B = read(), w[i].val = max(w[i].A, w[i].B),
    S += w[i].A;
  sort(w + 1, w + 1 + n, cmp);
  for (int i = 1; i <= n; i++) pre[i] = pre[i - 1] + w[i].val;
  long long ansx = 0, ansy = 1;
  for (int i = 1; i <= n; i++) {
    int l = 1, r = n, ps = -1;
    while (l <= r) {
      int mid = (l + r) / 2;
      if (getval(mid, i) >= S)
        r = mid - 1;
      else if (getval(mid, i) + w[i].B < S)
        l = mid + 1;
      else {
        ps = mid;
        break;
      }
    }
    if (ps == -1) continue;
    int id = i;
    long long S2 = getval(ps, i) + w[i].B - S;
    long long nowx = n - ps - (ps < i), nowy = 1;
    long long fx = S2, fy = w[id].B;
    long long d = gcd(fx, fy);
    fx /= d;
    fy /= d;
    nowy = fy;
    nowx = fx + fy * nowx;
    d = gcd(fx, fy);
    fx /= d;
    fy /= d;
    if (1.0 * ansx * nowy <= 1.0 * ansy * nowx) ansx = nowx, ansy = nowy;
  }
  ansy = 1LL * ansy * n;
  long long d = gcd(ansx, ansy);
  ansx /= d;
  ansy /= d;
  pr1(ansx);
  pr2(ansy);
  return 0;
}
