func_code_string: #include <bits/stdc++.h>   using namespace std;   vector<long long> graph[100005];   vector<pair<long long, long long> > graph_p[100005];   vector<pair<long long, long long> > op;   vector<long long> vis(100005, 0);   long long power(long long x, long long y) {     long long res = 1;     x = x % 1000000009;     if (x == 0) return 0;     while (y > 0) {       if (y & 1) res = ((res % 1000000009) * (x % 1000000009)) % 1000000009;       y = y >> 1;       x = ((x % 1000000009) * (x % 1000000009)) % 1000000009;     }     return res;   }   void init_graph(long long n, long long m) {     cin >> n >> m;     for (long long i = 1; i <= m; i++) {       long long a, b;       cin >> a >> b;       graph[a].push_back(b);       graph[b].push_back(a);     }   }   void sieve(long long n) {     bool prime[n + 1];     memset(prime, true, sizeof(prime));     for (long long p = 2; p * p <= n; p++) {       if (prime[p] == true) {         for (long long i = p * p; i <= n; i += p) prime[i] = false;       }     }   }   long long n, h, l[2000005], r[2000005], ans;   long long sum[2000005], de[2000005];   void we_have_choices() {     cin >> n >> h;     for (long long i = 1; i <= n; i++) {       cin >> l[i] >> r[i];       sum[i] = sum[i - 1] + r[i] - l[i];       if (i == 1)         de[i] = 0;       else         de[i] = de[i - 1] + l[i] - r[i - 1];     }     for (long long i = 1; i <= n; i++) {       long long pos = lower_bound(de + i, de + n + 1, de[i] + h) - de;       ans = max(ans, sum[pos - 1] - sum[i - 1] + h);     }     cout << ans <<   n ;   }   int32_t main() {     ios_base::sync_with_stdio(false), cin.tie(nullptr);     ;     long long t = 1;     while (t--) we_have_choices();     return 0;   }   