import io.StdIn.readLine


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

    var t, a = 1.0

    for (i <- 1 to n) {
      val Array(ti, ai) = readLine().split(' ').map(_.toDouble)
      val times = Math.max(Math.ceil(t / ti), Math.ceil(a / ai))
      t = ti * times
      a = ai * times
    }

    println((t + a).toString.split('.')(0))
  }
}
