#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long inf = mod * mod;
const long long d2 = (mod + 1) / 2;
const double EPS = 1e-10;
const double INF = 1e+10;
const double PI = acos(-1.0);
const int C_SIZE = 5121000;
namespace {
long long fact[C_SIZE];
long long finv[C_SIZE];
long long inv[C_SIZE];
long long Comb(int a, int b) {
  if (a < b || b < 0) return 0;
  return fact[a] * finv[b] % mod * finv[a - b] % mod;
}
void init_C(int n) {
  fact[0] = finv[0] = inv[1] = 1;
  for (int i = 2; i < n; i++) {
    inv[i] = (mod - (mod / i) * inv[mod % i] % mod) % mod;
  }
  for (int i = 1; i < n; i++) {
    fact[i] = fact[i - 1] * i % mod;
    finv[i] = finv[i - 1] * inv[i] % mod;
  }
}
long long pw(long long a, long long b) {
  if (a < 0LL) return 0;
  if (b < 0LL) return 0;
  long long ret = 1;
  while (b) {
    if (b % 2) ret = ret * a % mod;
    a = a * a % mod;
    b /= 2;
  }
  return ret;
}
long long pw_mod(long long a, long long b, long long M) {
  if (a < 0LL) return 0;
  if (b < 0LL) return 0;
  long long ret = 1;
  while (b) {
    if (b % 2) ret = ret * a % M;
    a = a * a % M;
    b /= 2;
  }
  return ret;
}
int pw_mod_int(int a, int b, int M) {
  if (a < 0) return 0;
  if (b < 0) return 0;
  int ret = 1;
  while (b) {
    if (b % 2) ret = (long long)ret * a % M;
    a = (long long)a * a % M;
    b /= 2;
  }
  return ret;
}
int ABS(int a) { return max(a, -a); }
long long ABS(long long a) { return max(a, -a); }
double ABS(double a) { return max(a, -a); }
int sig(double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; }
}  // namespace
long long p[110000];
long long q[110000];
long long gcd(long long a, long long b) {
  while (a) {
    b %= a;
    swap(a, b);
  }
  return b;
}
struct wolf {
  long long bb, bs;
};
inline bool operator<(const wolf& a, const wolf& b) {
  return (__int128)a.bs * b.bb < (__int128)a.bb * b.bs;
}
pair<long long, int> P[110000];
long long bit[110000];
long long sum(int a, int b) {
  if (a) return sum(0, b) - sum(0, a - 1);
  long long ret = 0;
  for (; b >= 0; b = (b & (b + 1)) - 1) ret += bit[b];
  return ret;
}
void add(int a, long long b) {
  for (; a < 110000; a |= a + 1) bit[a] += b;
}
int main() {
  int a;
  scanf("%d", &a);
  long long rem = 0;
  long long cnt = 0;
  long long A = 0;
  for (int i = 0; i < a; i++) {
    scanf("%lld%lld", p + i, q + i);
    P[i] = make_pair(max(p[i], q[i]), i);
    A += p[i];
  }
  std::sort(P, P + a);
  wolf ret;
  ret.bs = 0;
  ret.bb = 1;
  for (int i = 0; i < a; i++) {
    add(i, P[i].first);
  }
  for (int i = 0; i < a; i++) {
    add(i, -P[i].first);
    int left = -1;
    int right = a;
    long long S = A;
    while (left + 1 < right) {
      int M = (left + right) / 2;
      long long tmp = sum(M, a);
      if (tmp > S) {
        left = M;
      } else
        right = M;
    }
    long long am = S - sum(right, a);
    if (am > q[P[i].second]) continue;
    long long cnt = right;
    if (i >= right) cnt++;
    wolf tmp;
    tmp.bs = cnt * q[P[i].second] - am;
    tmp.bb = q[P[i].second] * a;
    if (ret < tmp) ret = tmp;
    add(i, P[i].first);
  }
  long long g = gcd(ret.bs, ret.bb);
  ret.bs /= g;
  ret.bb /= g;
  printf("%lld %lld\n", ret.bs, ret.bb);
}
