…
include[HTML_REMOVED]
using namespace std;
define N 100100
int n;
int k;
int H[N],W[N];
bool check(int m)
{
int res=0;
for (int i = 1; i <= n; i++)
{
res += (H[i] / m) * (W[i] / m);
}
if (res >= k)
return true;
else
return false;
}
int main()
{
cin >> n >> k;
for (int i = 1; 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;
}