#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 100005;
inline long long readint() {
  long long res = 0, f = 1;
  char c = 0;
  while (!isdigit(c)) {
    c = getchar();
    if (c == '-') f = -1;
  }
  while (isdigit(c)) res = res * 10 + c - '0', c = getchar();
  return res * f;
}
long long n;
pair<long long, long long> s[MAXN], t[MAXN];
long long ansp = 1 << 30, ansq = 1;
inline void getMin(long long x, long long y) {
  if ((__int128)x * ansq < (__int128)y * ansp) ansp = x, ansq = y;
}
long long pre[MAXN], sum;
inline long long calc(long long x, long long mid) {
  long long val = max(s[x].first, s[x].second);
  return t[mid].first <= val ? pre[mid] - val : pre[mid];
}
inline long long binSearch(long long x) {
  long long left = 1, right = n, res = -1, mid;
  while (left <= right) {
    mid = (left + right) >> 1;
    if (calc(x, mid) >= sum - s[x].second)
      res = mid, right = mid - 1;
    else
      left = mid + 1;
  }
  return res;
}
inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
signed main() {
  n = readint();
  for (long long i = 1; i <= n; i++) {
    s[i].first = readint(), s[i].second = readint();
    t[i].first = max(s[i].first, s[i].second), t[i].second = i;
    sum += s[i].first;
  }
  sort(t + 1, t + n + 1), reverse(t + 1, t + n + 1);
  for (long long i = 1; i <= n; i++) pre[i] = pre[i - 1] + t[i].first;
  for (long long i = 1; i <= n; i++) {
    long long res = binSearch(i);
    long long val = sum - calc(i, res);
    if (t[res].first <= max(s[i].first, s[i].second)) res--;
    if (val < 0) continue;
    getMin(1ll * res * s[i].second + val, s[i].second);
  }
  ansq *= n, ansp = ansq - ansp;
  if (ansp <= 0) {
    cout << 0 << " " << 1 << endl;
    return 0;
  }
  long long g = gcd(ansp, ansq);
  cout << ansp / g << " " << ansq / g << endl;
  return 0;
}
