#include <bits/stdc++.h>
using namespace std;
void inout() {}
long long int n, h;
long long int pref[300005];
bool check(long long int l, vector<pair<long long int, long long int>> &a,
           long long int r) {
  long long int left = lower_bound(a.begin(), a.end(),
                                   pair<long long int, long long int>(l, -1)) -
                       a.begin();
  long long int right = lower_bound(a.begin(), a.end(),
                                    pair<long long int, long long int>(r, -1)) -
                        a.begin();
  long long int sum = pref[right] - pref[left];
  if (left > 0) sum += max(0LL, a[left - 1].second - l);
  return (r - l - sum) > h;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  inout();
  cin >> n >> h;
  vector<pair<long long int, long long int>> a(n);
  for (auto &i : a) cin >> i.first >> i.second;
  pref[0] = 0;
  for (long long int i = 1; i <= n; i++) {
    pref[i] = pref[i - 1] + (a[i - 1].second - a[i - 1].first);
  }
  long long int ans = 0, ans1;
  for (long long int i = 0; i < n; i++) {
    long long int l = -2e9;
    long long int r = a[i].second + 1;
    ans1 = -1;
    while (r >= l) {
      long long int mid = (l + r) / 2;
      if (check(mid, a, a[i].second + 1)) {
        ans1 = mid;
        l = mid + 1;
      } else
        r = mid - 1;
    }
    ans = max(ans, a[i].second - ans1);
  }
  cout << ans << endl;
  return 0;
}
