#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<pair<int, int> > near, far;
  cat BA_dif = 0;
  for (int i = 0; i < N; i++) {
    int a, b;
    cin >> a >> b;
    if (a <= b) {
      near.push_back({b, a});
      BA_dif += b - a;
    } else
      far.push_back({a, b});
  }
  sort(begin(near), end(near));
  vector<cat> B_sum_near(near.size() + 1, 0);
  for (int i = 0; i < (int)near.size(); i++)
    B_sum_near[i + 1] = B_sum_near[i] + near[i].first;
  sort(begin(far), end(far));
  cat ans_num = 0, ans_denom = 1;
  for (int f = 0, n = 0; n < (int)near.size(); n++) {
    cat dif = BA_dif - B_sum_near[n];
    if (dif < 0) continue;
    static cat A_sum_far = 0;
    while (f < (int)far.size() && dif >= A_sum_far + far[f].first) {
      A_sum_far += far[f].first;
      f++;
    }
    while (f > 0 && dif < A_sum_far) {
      f--;
      A_sum_far -= far[f].first;
    }
    dif -= A_sum_far;
    if (dif < 0 || dif > near[n].first) continue;
    cat P_num = 1LL * near[n].first * (n + f) + dif;
    cat P_denom = near[n].first;
    cat P = P_num / P_denom, ans = ans_num / ans_denom;
    if (P > ans)
      ans_num = P_num, ans_denom = P_denom;
    else if (P == ans &&
             (P_num % P_denom) * ans_denom > (ans_num % ans_denom) * P_denom)
      ans_num = P_num, ans_denom = P_denom;
  }
  for (int f = 0; f < (int)far.size(); f++) {
    int n =
        upper_bound(begin(near), end(near), pair<int, int>(far[f].second, -1)) -
        begin(near);
    cat dif = BA_dif - B_sum_near[n] + far[f].second - far[f].first;
    if (dif < 0) continue;
    static cat A_sum_far = 0;
    static int cnt_far = 0;
    cat cur_A_sum_far = A_sum_far;
    int cur_cnt_far = cnt_far;
    if (cur_cnt_far > f) {
      cur_A_sum_far += far[cur_cnt_far].first - far[f].first;
      cur_cnt_far++;
    }
    while (cur_cnt_far < (int)far.size()) {
      if (cur_cnt_far == f) {
        cur_cnt_far++;
        continue;
      }
      if (cur_A_sum_far + far[cur_cnt_far].first > dif) break;
      cur_A_sum_far += far[cur_cnt_far].first;
      cur_cnt_far++;
    }
    while (cnt_far < cur_cnt_far - (f < cur_cnt_far)) {
      A_sum_far += far[cnt_far].first;
      cnt_far++;
    }
    if (cur_cnt_far > f) cur_cnt_far--;
    dif -= cur_A_sum_far;
    if (dif < 0 || dif > far[f].second) continue;
    cat P_num = 1LL * far[f].second * (n + cur_cnt_far) + dif;
    cat P_denom = far[f].second;
    cat P = P_num / P_denom, ans = ans_num / ans_denom;
    if (P > ans)
      ans_num = P_num, ans_denom = P_denom;
    else if (P == ans &&
             (P_num % P_denom) * ans_denom > (ans_num % ans_denom) * P_denom)
      ans_num = P_num, ans_denom = P_denom;
  }
  cat g = gcd(ans_num, ans_denom * N);
  cout << ans_num / g << " " << ans_denom * N / g << "\n";
  return 0;
}
