import std.stdio;
import std.conv, std.array, std.algorithm, std.string;
import std.math, std.random, std.range, std.datetime;
import std.bigint;

void main(){
	int n = readln.chomp.to!int;
	
	int[] ts, as;
	foreach(i; 0 .. n){
		int[] tmp = readln.chomp.split.map!(to!int).array;
		ts ~= tmp[0], as ~= tmp[1];
		}
	
	long t, a;
	t = 1, a = 1;
	
	long ad, td;
	long d;
	foreach(i; 0 .. n){
		if(t % ts[i] == 0) td = t / ts[i];
		else td = t / ts[i] + 1;
		if(a % as[i] == 0) ad = a / as[i];
		else ad = a / as[i] + 1;
		
		if(td < ad) d = ad; else d = td;
		
		t = ts[i] * d, a = as[i] * d;
		debug writeln(ts[i], ",", as[i], "; ", t, ",", a);
		}
	
	(t + a).writeln;
	
	}