#include <bits/stdc++.h>
using namespace std;
int n;
long long a[101010], b[101010], ta[101010], tb[101010];
pair<long long, long long> p[101010];
pair<long long, long long> pp[101010];
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    p[i] = pair<long long, long long>(a[i], b[i]);
  }
  sort(p, p + n);
  long long ma = 0, kk = 0;
  for (int i = 0; i < n; i++) {
    ta[i + 1] = p[i].first + ta[i];
    tb[i + 1] = p[i].second + tb[i];
    if (tb[i + 1] - ta[i + 1] >= ma) {
      ma = tb[i + 1] - ta[i + 1];
      kk = i + 1;
    }
    pp[i] = make_pair(p[i].second, p[i].first);
  }
  long long ans0 = 0, ans1 = 1;
  double ans = -1;
  for (; kk <= n; kk++) {
    ma = tb[kk] - ta[kk];
    sort(pp, pp + kk);
    for (int i = 0; i < kk; i++) {
      ta[i + 1] = pp[i].second + ta[i];
      tb[i + 1] = pp[i].first + tb[i];
    }
    int pos = lower_bound(tb, tb + n + 1, ma) - tb;
    if (ans <
        (double)((ma - tb[pos - 1]) + (pos - 1) * (tb[pos] - tb[pos - 1])) /
            (n * (tb[pos] - tb[pos - 1]))) {
      if (tb[pos] == ma) {
        ans0 = pos;
        ans1 = n;
      } else {
        ans0 = (ma - tb[pos - 1]) + (pos - 1) * (tb[pos] - tb[pos - 1]);
        ans1 = n * (tb[pos] - tb[pos - 1]);
      }
      ans = (double)ans0 / ans1;
    }
  }
  cout << ans0 / gcd(ans0, ans1) << " " << ans1 / gcd(ans0, ans1) << endl;
  return 0;
}
