#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];
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;
  for (int i = 0; i < n; i++) {
    ta[i + 1] += p[i].first + ta[i];
    tb[i + 1] += p[i].second + tb[i];
    ma = max(tb[i + 1] - ta[i + 1], ma);
  }
  long long ans0 = 0, ans1 = 1;
  int pos = lower_bound(tb, tb + n + 1, ma) - tb;
  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]);
  }
  cout << ans0 / gcd(ans0, ans1) << " " << ans1 / gcd(ans0, ans1) << endl;
  return 0;
}
