#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a > b) {
    swap(a, b);
  }
  if (a == 0) {
    return b;
  } else {
    return gcd(b % a, a);
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, a, b, c, ind, A, B, C, D, ai, bi, bunbo, bunsi, G, P, Q;
  cin >> n;
  vector<tuple<int, int, int>> v(n);
  vector<int> ca(n + 1), cb(n + 1);
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    c = a - b;
    v[i] = make_tuple(c, a, b);
  }
  sort(v.begin(), v.end());
  if (get<0>(v[0]) > 0) {
    cout << 0 << ' ' << 1 << endl;
    return 0;
  }
  ca[0] = 0;
  cb[n] = 0;
  for (int i = 0; i < n; i++) {
    ca[i + 1] = get<1>(v[i]) + ca[i];
    cb[n - i - 1] = get<2>(v[n - i - 1]) + cb[n - i];
  }
  for (int i = 1; i < n; i++) {
    if (ca[i] == cb[i]) {
      ind = i;
      A = ca[i];
      B = cb[i];
      break;
    } else if (ca[i] < cb[i] && ca[i + 1] > cb[i + 1]) {
      ind = i;
      A = ca[i];
      B = cb[i + 1];
      break;
    }
  }
  ai = get<1>(v[ind]);
  bi = get<2>(v[ind]);
  if (A > B) {
    C = bi * (ai + bi);
    D = bi * (bi - A + B);
  } else if (A < B) {
    C = ai * (ai + bi);
    D = (ai - B + A) * bi;
  } else {
    C = ind;
    D = 0;
  }
  bunsi = ind * C + D;
  bunbo = n * C;
  G = gcd(bunsi, bunbo);
  P = bunsi / G;
  Q = bunbo / G;
  cout << P << ' ' << Q;
}
