#include <bits/stdc++.h>
using namespace std;
using vint = vector<long long>;
using vvint = vector<vint>;
using pint = pair<long long, long long>;
using vpint = vector<pint>;
template <typename T>
using priority_queue_rev = priority_queue<T, vector<T>, greater<T>>;
constexpr double PI = 3.1415926535897932384626433832795028;
constexpr long long DY[8] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr long long DX[8] = {1, 0, -1, 0, 1, -1, -1, 1};
long long gcd(long long a, long long b) {
  while (b) {
    swap(a %= b, b);
  }
  return a;
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
template <typename T>
void fin(T mes) {
  cout << mes << endl;
  exit(0);
}
template <typename T, typename U>
bool chmax(T &a, const U &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T, typename U>
bool chmin(T &a, const U &b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &rhs) {
  os << "(" << rhs.first << ", " << rhs.second << ")";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &rhs) {
  os << "{";
  for (auto itr = rhs.begin(); itr != rhs.end(); itr++) {
    os << *itr << (next(itr) != rhs.end() ? ", " : "");
  }
  os << "}";
  return os;
}
struct setup {
  static constexpr long long PREC = 20;
  setup() {
    cout << fixed << setprecision(PREC);
    cerr << fixed << setprecision(PREC);
  };
} setup;
struct rational {
  long long num, den;
  static long long gcd(long long a, long long b) {
    if (a < 0) {
      a = -a;
    }
    if (b < 0) {
      b = -b;
    }
    while (b) {
      std::swap(a %= b, b);
    }
    return a;
  }
  void reduce() {
    long long g = gcd(num, den);
    num /= g, den /= g;
  }
  rational(long long num_ = 0, long long den_ = 1, bool reduction = true)
      : num(num_), den(den_) {
    if (reduction) {
      reduce();
    }
    if (den < 0) {
      num = -num, den = -den;
    }
  }
  bool operator==(const rational &rhs) const {
    return num == rhs.num && den == rhs.den;
  }
  bool operator!=(const rational &rhs) const {
    return std::rel_ops::operator!=(*this, rhs);
  }
  bool operator<(const rational &rhs) const {
    return num * rhs.den < rhs.num * den;
  }
  bool operator>(const rational &rhs) const {
    return std::rel_ops::operator>(*this, rhs);
  }
  bool operator<=(const rational &rhs) const {
    return std::rel_ops::operator<=(*this, rhs);
  }
  bool operator>=(const rational &rhs) const {
    return std::rel_ops::operator>=(*this, rhs);
  }
  rational &operator+=(const rational &rhs) {
    num = num * rhs.den + rhs.num * den, den *= rhs.den;
    reduce();
    return *this;
  }
  rational &operator-=(const rational &rhs) { return *this += -rhs; }
  rational &operator*=(const rational &rhs) {
    num *= rhs.num, den *= rhs.den;
    reduce();
    return *this;
  }
  rational &operator/=(const rational &rhs) { return *this *= rhs.inv(); }
  rational operator+() const { return *this; }
  rational operator-() const { return rational(-num, den, false); }
  rational operator+(const rational &rhs) const {
    return rational(*this) += rhs;
  }
  rational operator-(const rational &rhs) const {
    return rational(*this) -= rhs;
  }
  rational operator*(const rational &rhs) const {
    return rational(*this) *= rhs;
  }
  rational operator/(const rational &rhs) const {
    return rational(*this) /= rhs;
  }
  rational inv() const { return rational(den, num, false); }
  rational pow(long long n) const {
    if (n < 0) {
      return pow(-n).inv();
    }
    rational ret(1, 1, false), mul = *this;
    while (n > 0) {
      if (n & 1) {
        ret.num *= mul.num, ret.den *= mul.den;
      }
      mul.num *= mul.num, mul.den *= mul.den;
      n >>= 1;
    }
    return ret;
  }
  double to_double() const { return (double)num / den; }
  friend std::istream &operator>>(std::istream &is, rational &rhs) {
    long long n, d;
    char s;
    is >> n >> s >> d;
    rhs = rational(n, d);
    return is;
  }
  friend std::ostream &operator<<(std::ostream &os, const rational &rhs) {
    return os << rhs.num << " / " << rhs.den;
  }
};
template <typename F>
long long discrete_binary_search(long long ok, long long ng, F is_ok) {
  while (abs(ok - ng) > 1) {
    long long mid = (ok + ng) / 2;
    (is_ok(mid) ? ok : ng) = mid;
  }
  return ok;
}
long long N;
long long A[110000], B[110000];
pint mB[110000];
long long mcc[110000];
signed main() {
  cin >> N;
  long long S = 0;
  for (long long i = 0; i < (N); i++) {
    cin >> A[i] >> B[i];
    S += A[i];
    mB[i] = {max(A[i], B[i]), B[i]};
  }
  sort(mB, mB + N), reverse(mB, mB + N);
  for (long long i = 0; i < (N); i++) {
    mcc[i + 1] = mcc[i] + mB[i].first;
  }
  rational ans = 0;
  for (long long i = 0; i < (N); i++) {
    long long k = discrete_binary_search(N - 1, -1, [&](long long x) {
      long long a;
      if (x > i) {
        a = mcc[x + 1] - mB[i].first;
      } else {
        a = mcc[x];
      }
      return a >= S - mB[i].second;
    });
    long long a;
    if (k > i) {
      a = mcc[k + 1] - mB[i].first;
    } else {
      a = mcc[k];
    }
    long long b = S - a;
    if (b < 0) {
      continue;
    }
    chmax(ans, -(rational(b) / mB[i].second + k) + N);
  }
  ans /= N;
  cout << ans.num << " " << ans.den << endl;
}
