import io.StdIn.readLine


object Main {
  def main(args: Array[String]): Unit = {
    val n = readLine().toInt

    var t, a = BigDecimal(1.0)

    for (i <- 1 to n) {
      val Array(ti, ai) = readLine().split(' ').map(BigDecimal(_))
      val x = (t / ti).setScale(0, BigDecimal.RoundingMode.CEILING)
      val y = (a / ai).setScale(0, BigDecimal.RoundingMode.CEILING)
      val times = if (x < y) y else x
      t = ti * times
      a = ai * times
    }

    println((t + a).toBigInt)
  }
}
