#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10, mod = 1e9 + 7;
const long long MX = 2e9;
int s[N], f[N];
long long ps[N];
vector<pair<long long, int> > v;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, h;
  cin >> n >> h;
  long long ret = 0;
  for (int i = 0; i < n; i++) {
    cin >> s[i] >> f[i];
    if (i)
      ps[i] = ps[i - 1] + f[i] - s[i];
    else
      ps[i] = f[i] - s[i];
    v.push_back({f[i], i});
  }
  v.push_back({MX + 10, n});
  ps[n] = ps[n - 1];
  for (int i = 0; i < n; i++) {
    long long l = f[i], r = MX + 10;
    while (r - l > 1) {
      long long m = (l + r) / 2;
      auto it = upper_bound(v.begin(), v.end(), make_pair(m, -1));
      int num = (*it).second;
      num--;
      long long x = 0;
      if (i) x = ps[i - 1];
      if (num < n - 1 && m > s[num + 1]) x -= m - s[num + 1];
      x = (m - s[i]) - ps[num] + x;
      bool sw = false;
      if (num < n - 1 && s[num + 1] < m) sw = true;
      if (x < h || (x == h && !sw))
        l = m;
      else
        r = m;
    }
    ret = max(ret, l - s[i]);
  }
  cout << ret;
  return 0;
}
