#include<iostream>
#include<vector>
using namespace std;
const int N = 100010;
pair<int, int> PII[N];
int n;
int f(int a) // 边长为a
{
int sum = 0;
for(int i = 0;i < n;i++)
{
sum += (PII[i].first / a) * (PII[i].second /a);
}
return sum;
}
int main()
{
int k;
cin >> n >> k;
for(int i = 0;i < n;i++)
{
cin >> PII[i].first >> PII[i].second;
}
int l = 1, r = N;
while(l < r)
{
int mid = (l+r+1)/2;
if(f(mid) >= k) l = mid;
else r = mid - 1;
}
cout <<l << endl;
return 0;
}