func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MAXN = 200 * 1000 + 5;   pair<long long int, long long int> b[MAXN];   long long int dp[MAXN];   long long int rem[MAXN];   inline pair<long long int, long long int> cst(int x, int y) {     long long int tt = ((b[x].first - rem[y] + b[y].second - 1) / b[y].second);     return make_pair(tt + dp[y], rem[y] + tt * b[y].second - b[x].first);   }   bool cmp(const pair<long long int, long long int>& x,            const pair<long long int, long long int>& y) {     if (x.first != y.first) return x.first < y.first;     return x.second > y.second;   }   inline bool isBet(int i, int j, int k) { return !cmp(cst(i, k), cst(i, j)); }   int main() {     ios::sync_with_stdio(false);     int n;     long long int s;     cin >> n >> s;     for (int i = 0; i < n; i++) cin >> b[i].second >> b[i].first;     b[n].first = s;     sort(b, b + n, cmp);     assert(!b[0].first);     deque<pair<int, int> > cands;     cands.push_back(make_pair(0, 1));     long long int ans = cst(n, 0).first;     long long int lst = b[0].second;     for (int i = 1; i < n; i++) {       if (b[i].second <= lst) continue;       while (cands.size() > 1 && isBet(i, cands[1].first, cands[0].first))         cands.pop_front();       pair<long long int, long long int> tmp = cst(i, cands[0].first);       dp[i] = tmp.first;       rem[i] = tmp.second;       ans = min(ans, cst(n, i).first);       while (cands.size() && isBet(cands.back().second, i, cands.back().first))         cands.pop_back();       if (cands.size()) {         int d = cands.back().second, u = n - 1;         while (d < u - 1) {           int mid = (d + u) / 2;           if (isBet(mid, i, cands.back().first))             u = mid;           else             d = mid;         }         if (isBet(u, i, cands.back().first)) cands.push_back(make_pair(i, u));       }       lst = b[i].second;     }     cout << ans << endl;     return 0;   }   