#include<iostream>
using namespace std;
typedef long long ll;
const int N = 100010;
int n, m;
int h[N], w[N];
bool check(int mid)
{
ll res = 0;
for(int i = 0; i < n; i ++)
{
res += (ll)h[i] / mid * (w[i] / mid);
if(res >= m) return true;
}
return false;
}
int main()
{
cin >> n >> m;
for(int i = 0; i < n; i ++) cin >> h[i] >> w[i];
int l = 1, r = 1e5;
while(l < r)
{
int mid = l + r + 1>> 1;
if(check(mid)) l = mid;
else r = mid - 1;
}
cout << l << endl;
}