#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
std::istream& operator>>(std::istream& i, pair<T, U>& p) {
  i >> p.first >> p.second;
  return i;
}
template <typename T>
std::istream& operator>>(std::istream& i, vector<T>& t) {
  for (auto& v : t) {
    i >> v;
  }
  return i;
}
template <typename T, typename U>
std::ostream& operator<<(std::ostream& o, const pair<T, U>& p) {
  o << p.first << ' ' << p.second;
  return o;
}
template <typename T>
std::ostream& operator<<(std::ostream& o, const vector<T>& t) {
  if (t.empty()) o << '\n';
  for (size_t i = 0; i < t.size(); ++i) {
    o << t[i] << " \n"[i == t.size() - 1];
  }
  return o;
}
template <typename T>
using minheap = priority_queue<T, vector<T>, greater<T>>;
template <typename T>
using maxheap = priority_queue<T, vector<T>, less<T>>;
unsigned int logceil(long long first) {
  return first ? 8 * sizeof(long long) - __builtin_clzll(first) : 0;
}
namespace std {
template <typename T, typename U>
struct hash<pair<T, U>> {
  hash<T> t;
  hash<U> u;
  size_t operator()(const pair<T, U>& p) const {
    return t(p.first) ^ (u(p.second) << 7);
  }
};
}  // namespace std
template <typename T, typename F>
T bsh(T l, T h, const F& f) {
  T r = -1, m;
  while (l <= h) {
    m = (l + h) / 2;
    if (f(m)) {
      l = m + 1;
      r = m;
    } else {
      h = m - 1;
    }
  }
  return r;
}
template <typename F>
double bshd(double l, double h, const F& f, double p = 1e-9) {
  unsigned int r = 3 + (unsigned int)log2((h - l) / p);
  while (r--) {
    double m = (l + h) / 2;
    if (f(m)) {
      l = m;
    } else {
      h = m;
    }
  }
  return (l + h) / 2;
}
template <typename T, typename F>
T bsl(T l, T h, const F& f) {
  T r = -1, m;
  while (l <= h) {
    m = (l + h) / 2;
    if (f(m)) {
      h = m - 1;
      r = m;
    } else {
      l = m + 1;
    }
  }
  return r;
}
template <typename F>
double bsld(double l, double h, const F& f, double p = 1e-9) {
  unsigned int r = 3 + (unsigned int)log2((h - l) / p);
  while (r--) {
    double m = (l + h) / 2;
    if (f(m)) {
      h = m;
    } else {
      l = m;
    }
  }
  return (l + h) / 2;
}
template <typename T>
T gcd(T a, T b) {
  if (a < b) swap(a, b);
  return b ? gcd(b, a % b) : a;
}
template <typename T>
class vector2 : public vector<vector<T>> {
 public:
  vector2() {}
  vector2(size_t a, size_t b, T t = T())
      : vector<vector<T>>(a, vector<T>(b, t)) {}
};
template <typename T>
class vector3 : public vector<vector2<T>> {
 public:
  vector3() {}
  vector3(size_t a, size_t b, size_t c, T t = T())
      : vector<vector2<T>>(a, vector2<T>(b, c, t)) {}
};
template <typename T>
class vector4 : public vector<vector3<T>> {
 public:
  vector4() {}
  vector4(size_t a, size_t b, size_t c, size_t d, T t = T())
      : vector<vector3<T>>(a, vector3<T>(b, c, d, t)) {}
};
template <typename T>
class vector5 : public vector<vector4<T>> {
 public:
  vector5() {}
  vector5(size_t a, size_t b, size_t c, size_t d, size_t e, T t = T())
      : vector<vector4<T>>(a, vector4<T>(b, c, d, e, t)) {}
};
template <typename T>
struct Fenwick {
  explicit Fenwick(unsigned int N = 0, T t = T())
      : N(1u << logceil(N)), F(this->N, t), t(t) {}
  explicit Fenwick(const vector<T>& A, T t = T())
      : N(1u << logceil(A.size())), F(A), t(t) {
    F.resize(N);
    fill(F.begin() + A.size(), F.end(), t);
    for (int i = 0; i < N; i++) {
      int j = i + lsb(i + 1);
      if (j < N) F[j] += F[i];
    }
  }
  void add(int i, T v) {
    while (i <= N) {
      F[i] += v;
      i += lsb(i + 1);
    }
  }
  T sum(int i) const {
    T sum(t);
    while (i) {
      sum += F[i - 1];
      i -= lsb(i);
    }
    return sum;
  }
  T range(int i, int j) const {
    j++;
    T s(t);
    while (j > i) {
      s += F[j - 1];
      j -= lsb(j);
    }
    while (i > j) {
      s -= F[i - 1];
      i -= lsb(i);
    }
    return s;
  }
  T get(int i) const { return range(i, i); }
  void set(int i, T v) { add(i, v - get(i)); }
  constexpr int lsb(int i) const { return i & -i; }
  unsigned int N;
  vector<T> F;
  T t;
  int max_lower(T v) {
    if (F[0] >= v) return -1;
    if (F[N - 1] < v) return N - 1;
    int first = 0;
    T a = t;
    for (int s = N >> 1; s > 0; s >>= 1)
      if (a + F[first + s - 1] < v) {
        a += F[first + s - 1];
        first += s;
      }
    return first;
  }
};
template <typename T>
struct Fenwick2 {
  explicit Fenwick2(unsigned int N = 0, T t = T())
      : N(1u << logceil(N)), F(this->N, this->N, t), t(t) {}
  void add(int first, int second, T v) {
    while (first <= N) {
      int z = second;
      while (z <= N) {
        F[first][z] += v;
        z += lsb(z + 1);
      }
      first += lsb(first + 1);
    }
  }
  T sum(int first, int second) {
    T sum(t);
    while (first <= N) {
      int z = second;
      while (z <= N) {
        sum += F[first][z];
        z -= lsb(z + 1);
      }
      first -= lsb(first + 1);
    }
    return sum;
  }
  T range(int x1, int y1, int x2, int y2) {
    T ans = sum(x2, y2);
    if (x1) ans -= sum(x1 - 1, y2);
    if (y1) ans -= sum(x2, y1 - 1);
    if (x1 && y1) ans += sum(x1 - 1, y1 - 1);
    return ans;
  }
  constexpr int lsb(int i) const { return i & -i; }
  unsigned int N;
  vector2<T> F;
  T t;
};
class Fraction {
  friend ostream& operator<<(ostream& os, const Fraction& f);

 public:
  Fraction(long long u = 0, long long v = 1) : u(u), v(v) { norm(); }
  bool operator==(const Fraction& o) const { return u == o.u && v == o.v; }
  bool operator!=(const Fraction& o) const { return u != o.u || v != o.v; }
  bool operator<(const Fraction& o) const { return u * o.v < o.u * v; }
  bool operator<=(const Fraction& o) const { return u * o.v <= o.u * v; }
  bool operator>(const Fraction& o) const { return u * o.v > o.u * v; }
  bool operator>=(const Fraction& o) const { return u * o.v >= o.u * v; }
  Fraction operator-(const Fraction& o) { return Fraction(-u, v); }
  Fraction& operator+=(const Fraction& o) {
    u = u * o.v + v * o.u;
    v *= o.v;
    return norm();
  }
  Fraction& operator-=(const Fraction& o) {
    u = u * o.v - v * o.u;
    v *= o.v;
    return norm();
  }
  Fraction& operator/=(const Fraction& o) {
    u = u * o.v;
    v = o.u * v;
    return norm();
  }
  Fraction& operator*=(const Fraction& o) {
    u *= o.u;
    v *= o.v;
    return norm();
  }
  Fraction operator+(const Fraction& o) const {
    Fraction f(*this);
    return f += o;
  }
  Fraction operator-(const Fraction& o) const {
    Fraction f(*this);
    return f -= o;
  }
  Fraction operator*(const Fraction& o) const {
    Fraction f(*this);
    return f *= o;
  }
  Fraction operator/(const Fraction& o) const {
    Fraction f(*this);
    return f /= o;
  }
  Fraction& norm() {
    long long g = gcd(abs(u), abs(v));
    u /= g;
    v /= g;
    if (v < 0) {
      u = -u;
      v = -v;
    }
    return *this;
  }
  long long u, v;
};
ostream& operator<<(ostream& os, const Fraction& f) {
  os << f.u << '/' << f.v;
  return os;
}
unsigned long long mulull(unsigned long long a, unsigned long long z,
                          unsigned long long mod) {
  __int128 result = ((__int128)a * (__int128)z) % (__int128)mod;
  return (unsigned long long)result;
}
pair<unsigned long long, unsigned long long> mulull(unsigned long long a,
                                                    unsigned long long b) {
  __int128 result = (__int128)a * (__int128)b;
  return {(unsigned long long)(result >> 64), (unsigned long long)result};
}
bool fractionGreaterOrEqual(long long a, long long b, long long c,
                            long long d) {
  if (b < 0) {
    b = -b;
    a = -a;
  }
  if (d < 0) {
    d = -d;
    c = -c;
  }
  return a < 0 && c < 0 ? mulull(-a, d) <= mulull(-c, b)
                        : (a >= 0) && (c < 0 || mulull(a, d) >= mulull(c, b));
}
bool fractionGreaterOrEqual(pair<long long, long long> a,
                            pair<long long, long long> b) {
  return fractionGreaterOrEqual(a.first, a.second, b.first, b.second);
}
bool fractionGreaterOrEqual(double a, double b, double c, double d) {
  return a / b >= c / d;
}
class DBalanceBeam {
 public:
  void solve(istream& cin, ostream& cout) {
    int N;
    cin >> N;
    vector<std::pair<int, int>> B(N);
    cin >> B;
    sort(B.begin(), B.end(), [](std::pair<int, int> a, std::pair<int, int> b) {
      return a.second > b.second || (a.second == b.second && a.first > b.first);
    });
    Fenwick<long long> BSum(N, 0LL);
    Fenwick<long long> Cnt(N, 0);
    long long good = 0;
    vector<pair<std::pair<int, int>, int>> Bad;
    for (int i = 0; i < N; ++i) {
      if (B[i].first <= B[i].second) {
        good += B[i].first;
        Cnt.add(i, 1);
        BSum.add(i, B[i].second);
      } else {
        Bad.push_back({B[i], i});
      }
    }
    long long bestNum = 0, bestDen = 1;
    sort(Bad.begin(), Bad.end(),
         [&](pair<std::pair<int, int>, int> a,
             pair<std::pair<int, int>, int> b) {
           return max(a.first.first, a.first.second) <
                  max(b.first.first, b.first.second);
         });
    for (int i = 0; i <= Bad.size(); ++i) {
      int first = bsh(0, N - 1, [&](int j) { return BSum.range(0, j) < good; });
      int left = first == -1 ? 0 : Cnt.sum(first + 1);
      long long tot = first == -1 ? 0LL : BSum.sum(first + 1);
      if (first < N - 1) {
        long long num =
            (Cnt.sum(N) - left) * long long(B[first + 1].second) - (good - tot);
        long long den = B[first + 1].second;
        if (fractionGreaterOrEqual(num, den, bestNum, bestDen)) {
          bestNum = num;
          bestDen = den;
        }
      } else {
      }
      if (i != Bad.size()) {
        Cnt.add(Bad[i].second, 1);
        BSum.add(Bad[i].second, Bad[i].first.second);
        good += Bad[i].first.first;
      }
    }
    bestDen *= N;
    long long g = gcd(bestNum, bestDen);
    cout << bestNum / g << ' ' << bestDen / g << '\n';
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  DBalanceBeam solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
