#include using namespace std; using ll = int; // <======== !!! using vi = vector; using ii = pair; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; ll M; cin >> n >> M; priority_queue, vector>, greater>> pq; for (int i = 0, a, b; i < n; ++i) cin >> a >> b, pq.push({(b + a - 1) / a, {a, b}}); ll done = 9e18, A = 0LL, B = 0LL; while (!pq.empty() && done > pq.top().first) { A += pq.top().second.first; B += pq.top().second.second; done = (M + B + A - 1LL) / A; pq.pop(); } cout << done << endl; return 0; }