----------/分巧克力/----------
#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
pair<int, int> num[N];
int n, k;
//-----*/简化循环写法/*-----//
#define f(i,n) for (int i = 0; i < n; i++)
//-----*/判断/*-----//
bool ck(int mid)
{
int ans = 0;
f(i,n)
ans += (num[i].first / mid) * (num[i].second / mid);
return ans >= k;
}
int main()
{
scanf("%d%d", &n, &k);
f(i,n)
scanf("%d%d", &num[i].first, &num[i].second);
`
//-----*/二分查找模板*/-----//
int l = 1, r = N;
while (l < r)
{
int mid = (l + r + 1) >> 1;
if ( ck(mid) ) l = mid;
else r = mid-1;
}
//-----*/输出r或l都可以*/-----//
printf("%d", l);
return 0;
}
`