import std.algorithm,
       std.string,
       std.array,
       std.range,
       std.stdio,
       std.conv;

void main() {
  ulong N = readln.chomp.to!ulong;
  ulong[2][] TAs = N.iota.map!(_ => readln.chomp.split.to!(ulong[2])).array;

  ulong gt, ga;

  foreach (idx, TA; TAs) {
    ulong t = TA[0],
          a = TA[1];

    if (gt <= t && ga <= a) {
      gt = t;
      ga = a;
    } else if (gt > t && ga > a) {
      ulong _a = (t + gt - 1) / t,
            _b = (a + ga - 1) / a;

      if (_a > _b) {
        gt = _a * t;
        ga = _a * a;
      } else {
        gt = _b * t;
        ga = _b * a;
      }
    } else {
      ulong tmp;

      if (ga > a) {
        tmp = (a + ga - 1) / a;
      } else {
        tmp = (t + gt - 1) / t;
      }

      gt = tmp * t;
      ga = tmp * a;
    }
  }

  writeln(gt + ga);
}
