#include <bits/stdc++.h>
using namespace std;
struct seg {
  int a, b, x;
  bool operator<(seg rhs) const { return x < rhs.x; }
} p[100100];
long long ap, aq;
long long gcd(long long x, long long y) {
  while (y) {
    x %= y;
    x ^= y ^= x ^= y;
  }
  return x;
}
bool ca(seg x, seg y) { return x.a < y.a; }
int main() {
  int n, f = 0;
  long long tx = 0, ty = 1;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &p[i].a, &p[i].b);
    p[i].x = max(p[i].a, p[i].b);
  }
  long long pre = 0;
  for (int i = 0; i < n; i++) {
    if (p[i].a < p[i].b) {
      pre += p[i].a - p[i].b;
    }
  }
  sort(p, p + n);
  for (int i = 0; i < n; i++) {
    if (pre + p[i].x <= 0) {
      pre += p[i].x;
      f++;
    } else if (pre + p[i].a - p[i].b <= 0) {
      long long cx = pre + max(p[i].a - p[i].b, 0);
      long long cy = p[i].b;
      if (-cx * ty > cy * tx) {
        tx = -cx;
        ty = cy;
      }
    }
  }
  long long x = 1LL * f * ty + tx;
  long long y = 1LL * n * ty;
  long long g = gcd(x, y);
  printf("%lld %lld\n", x / g, y / g);
  return 0;
}
