include[HTML_REMOVED]
using namespace std;
const int N=1010;
typedef pair[HTML_REMOVED] PII;
int n;
PII p[N];
vector[HTML_REMOVED] mul(vector[HTML_REMOVED] a,int b)
{
vector[HTML_REMOVED]c;
int t=0;
for(int i=0;i<a.size();i++)
{
t+=a[i]*b;
c.push_back(t%10);
t/=10;
}
while(t)
{
c.push_back(t%10);
t/=10;
}
return c;
}
vector[HTML_REMOVED] div(vector[HTML_REMOVED]a,int b)
{
vector[HTML_REMOVED] c;
bool is_first=true;
for(int i=a.size()-1,t=0;i>=0;i–)
{
t=t*10+a[i];
int x=t/b;
if(!is_first||x)
{
is_first=false;
c.push_back(x);
}
t%=b;
}
reverse(c.begin(),c.end());
return c;
}
vector[HTML_REMOVED] max_vec(vector[HTML_REMOVED] a,vector[HTML_REMOVED] b)
{
if(a.size()>b.size()) return a;
if(a.size()[HTML_REMOVED](a.rbegin(),a.rend()) > vector[HTML_REMOVED](b.rbegin(),b.rend())) return a;
return b;
}
int main()
{
cin>>n;
for(int i=0;i<=n;i)
{
int a,b;
cin>>a>>b;
p[i]={a*b,a};
}
sort(p+1,p+1+n);
vector[HTML_REMOVED] product(1,1);//乘积个数为1,初始为1;
vector[HTML_REMOVED] res(1,0);//个数为1,初始为0;
for(int i=0;i<=n;i)
{
if (i) res = max_vec(res, div(product, p[i].first / p[i].second));
product = mul(product, p[i].second);
}
for(int i=res.size()-1;i>=0;i–)
cout<<res[i];
cout<<endl;
return 0;
}