using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using static System.Math;
using static System.Array;
namespace AtCoderSolve
{
    class Solve
    {
        const int mod = 1000000007;
        const int INF = 2147483647;
        const long SINF = 9223372036854775807;

        static int N;
        static int[] T, A;
        //static string S;


        public static void Input()
        {
            var cin = new Scanner();
            N = int.Parse(Console.ReadLine());
            T = new int[N];
            A = new int[N];
            for(var i = 0; i < N; i++)
            {
                var input = cin.SplitReader();
                T[i] = input[0];
                A[i] = input[1];
            }
        }

        static void Main(string[] args)
        {
            Input();
            //var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            //Console.SetOut(sw);

            long tak = 0;
            long aok = 0;
            for(var i = 0; i < N; i++)
            {
                if (i == 0)
                {
                    tak = T[0];
                    aok = A[0];
                }
                else
                {
                    long r = Max((tak + T[i] - 1) / T[i], (aok + A[i] - 1) / A[i]);
                    tak = r * T[i];
                    aok = r * A[i];
                }
            }

            Console.WriteLine(tak + aok);

            //Console.Out.Flush();
        }

    }

    public class Scanner
    {
        public int[] SplitReader()
        {
            int[] array = Console.ReadLine().Split().Select(int.Parse).ToArray();
            return array;
        }
        public long[] SplitReaderL()
        {
            long[] array = Console.ReadLine().Split().Select(long.Parse).ToArray();
            return array;
        }

        public int[] MultiLineReader(int N)
        {
            int[] ret = new int[N];
            for(var i = 0; i < N; i++)
            {
                ret[i] = int.Parse(Console.ReadLine());
            }

            return ret;
        }
        public long[] MultiLineReaderL(int N)
        {
            long[] ret = new long[N];
            for (var i = 0; i < N; i++)
            {
                ret[i] = long.Parse(Console.ReadLine());
            }

            return ret;
        }

    }

    public class Graph
    {
        public void Dfs(List<List<int>> graph, bool[] seen, int v)
        {
            seen[v] = true;
            //初めて訪れたタイミングでここの処理

            foreach (var next in graph[v])
            {
                if (seen[next] == true) { continue; }
                Dfs(graph, seen, next);
            }
            //行き先がない状態になったらこの部分の処理

        }

        public void Gin(List<List<int>> graph, int size)
        {
            for (var i = 0; i < size; i++)
            {
                graph.Add(new List<int>());

            }
        }

        public void InitializeFalse(bool[] seen)
        {
            for (var i = 0; i < seen.Length; i++)
            {
                seen[i] = false;
            }
        }

        public bool AllTrue(bool[] seen)
        {
            for (var i = 0; i < seen.Length; i++)
            {
                if (!seen[i])
                {
                    return false;
                }
            }
            return true;
        }
    }
}

    



Measured memory_bytes: 13396