#include <bits/stdc++.h>
using namespace std;
int n, h, x1[200005], x2[200005];
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> h;
  for (int i = 1; i <= n; i++) cin >> x1[i] >> x2[i];
  int maxx = 0, nowlen = 0, nowhigh = h, nowr = 1, nowsub = 0;
  for (int i = 1; i <= n; i++) {
    if (nowsub) {
      int t = min(nowsub, nowhigh);
      nowlen += t;
      nowhigh -= t;
      nowsub -= t;
    }
    if (!nowsub) {
      while (nowr <= n && nowhigh) {
        nowlen += x2[nowr] - x1[nowr];
        nowr++;
        if (nowr <= n) {
          int t = min(nowhigh, x1[nowr] - x2[nowr - 1]);
          nowlen += t;
          nowhigh -= t;
          if (t != x1[nowr] - x2[nowr - 1])
            nowsub = x1[nowr] - x2[nowr - 1] - t;
        }
      }
      if (nowhigh) {
        nowlen += nowhigh;
        nowhigh = 0;
      }
    }
    maxx = max(maxx, nowlen);
    if (i < n) {
      nowlen -= x1[i + 1] - x1[i];
      nowhigh += x1[i + 1] - x2[i];
    }
  }
  cout << maxx << endl;
  return 0;
}
