#include using namespace std; using i32 = int; using i64 = long long; using i128 = __int128_t; using f64 = double; using p2 = pair; using el = tuple; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(18); _main(); } void _main() { i64 n, m; cin >> n >> m; vector t; for (i64 i = 0; i < n; i++) { i64 a, b; cin >> a >> b; i64 d = (m - a) / b; t.push_back(d); } sort(t.begin(), t.end()); i64 l = 0, r = n; while (r - l > 1) { i64 mid = (l + r) / 2; bool ok = true; for (i64 i = 0; i * mid < n; i++) { i64 j = i * mid; ok &= t[j] >= i; } if (ok) r = mid; else l = mid; } cout << r << "\n"; }