#include <bits/stdc++.h>
using namespace std;
using cat = long long;
cat gcd(cat x, cat y) {
  if (x > y) swap(x, y);
  return (x == 0) ? y : gcd(y % x, x);
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(10);
  int N;
  cin >> N;
  vector<int> far, near;
  cat A_sum = 0;
  for (int i = 0; i < N; i++) {
    int a, b;
    cin >> a >> b;
    if (a < b) {
      near.push_back(b);
      A_sum += a;
    } else
      far.push_back(a);
  }
  sort(begin(near), end(near));
  reverse(begin(near), end(near));
  sort(begin(far), end(far));
  cat ans_num = 0, ans_denom = 1;
  cat B_sum = 0;
  for (int f = 0, d = 0; f <= (int)far.size(); f++) {
    while (d < (int)near.size() && near[d] + B_sum <= A_sum) {
      B_sum += near[d];
      d++;
    }
    if (d == (int)near.size()) break;
    cat P_num = 1LL * near[d] * (near.size() + f - d) - (A_sum - B_sum);
    cat P_denom = near[d];
    cat g = gcd(P_num, P_denom);
    P_num /= g, P_denom /= g;
    cat P = P_num / P_denom;
    cat ans = ans_num / ans_denom;
    if (P > ans)
      ans_num = P_num, ans_denom = P_denom;
    else if (P == ans) {
      cat dif = (P_num % P_denom) * ans_denom - (ans_num % ans_denom) * P_denom;
      if (dif > 0) ans_num = P_num, ans_denom = P_denom;
    }
    if (f < (int)far.size()) A_sum += far[f];
  }
  cat g = gcd(ans_num, ans_denom * N);
  cout << ans_num / g << " " << ans_denom * N / g << "\n";
  return 0;
}
