#include<bits/stdc++.h>
using namespace std;
const int N=100010;
int h[N],w[N];
int num(int hi,int wi,int x)
{
if(x>min(hi,wi))return 0;
return (hi/x)*(wi/x);
}
int main()
{
int x=1e5;
int n,K;cin>>n>>K;
for(int i=0;i<n;i++)
{
scanf("%d %d\n",&h[i],&w[i]);
}
int l=1,r=1e5;
while(l<r)
{
int mid=(l+r)/2+1;
int sum=0;
for(int i=0;i<n;i++)
{
sum+=num(h[i],w[i],mid);
}
if(sum>=K)l=mid;
else r=mid-1;
}
cout<<l<<endl;
return 0;
}