#include <bits/stdc++.h>
using namespace std;
const long long N = 100005;
struct frac {
  long long x, y;
  inline frac(const long long& X = 0, const long long& Y = 0) {
    x = X;
    y = Y;
  }
  friend inline bool operator<(const frac& A, const frac& B) {
    return 1.0 * A.x * B.y < 1.0 * A.y * B.x;
  }
  friend inline bool operator>(const frac& A, const frac& B) {
    return 1.0 * A.x * B.y > 1.0 * A.y * B.x;
  }
} ans(0, 1);
struct data {
  long long a, b, val;
  friend inline bool operator<(const data& A, const data& B) {
    return A.val < B.val;
  }
} p[N];
long long pfx[N], n, sum;
inline long long gcd(const long long& x, const long long& y) {
  return y ? gcd(y, x % y) : x;
}
signed main() {
  register long long i;
  for (scanf("%lld", &n), i = 1; i <= n; ++i)
    scanf("%lld%lld", &p[i].a, &p[i].b), p[i].val = max(p[i].a, p[i].b),
                                         sum += max(p[i].b - p[i].a, 0LL);
  for (sort(p + 1, p + n + 1), i = 1; i <= n; ++i)
    pfx[i] = pfx[i - 1] + p[i].val;
  for (i = 1; i <= n; ++i) {
    long long cur = sum;
    if (p[i].a > p[i].b) cur += p[i].b - p[i].a;
    long long l = 1, r = n, mid;
    while (l <= r)
      if ((pfx[mid = l + r >> 1] -
           ((mid = l + r >> 1) > i ? p[mid = l + r >> 1].val : 0)) <= cur)
        l = mid + 1;
      else
        r = mid - 1;
    frac ret(cur - (pfx[l - 1] - ((l - 1) > i ? p[l - 1].val : 0)), p[i].b);
    ret = min(ret, frac(1, 1));
    ret.x += ret.y * (l - 1 - (l > i));
    ans = max(ans, ret);
  }
  long long g = gcd(ans.x, ans.y *= n);
  return printf("%lld %lld", ans.x / g, ans.y / g), 0;
}
