#include #include int co[100100][2]; int coun(int n, int x) { int sum = 0; for (int i = 0; i < n; i++) { sum += (co[i][0] / x) * (co[i][1] / x); } return sum; } int binary(int n, int k) { int l = 0, r = 100000; while (l < r) { int mid = (r - l) / 2 + l; if (coun(n, mid) > k) r = mid - 1; else if (coun(n, mid) < k) l = mid + 1; else return mid; } return r; } int main() { int n; int k; scanf("%d%d", &n, &k); for (int i = 0; i < n; i++) scanf("%d%d", &co[i][0], &co[i][1]); printf("%d\n", binary(n, k)); }