#include <bits/stdc++.h>
const int N = 220000;
int a[N], b[N];
int max(int a, int b) { return a > b ? a : b; }
int ans = -1, n, h, queue[N];
int x1, x2, f, sum, fold, sold;
int main() {
  scanf("%d%d", &n, &h);
  scanf("%d%d", &x1, &x2);
  for (int i = 1; i <= n; ++i) {
    a[i] = x2 - x1;
    scanf("%d", &x1);
    b[i] = x1 - x2;
    scanf("%d", &x2);
  }
  b[n] = 0x3f3f3f3f;
  f = sum = 0;
  for (int l = 1, r = 0; l <= n; ++l) {
    bool flag = false;
    for (++r; r <= n; ++r) {
      if (f + b[r] < h) {
        sum += a[r] + b[r];
        f += b[r];
      } else {
        flag = true;
        fold = f, sold = sum;
        sum += a[r] + h - f;
        f = h;
        break;
      }
    }
    ans = max(ans, sum);
    if (flag) sum = sold, f = fold, --r;
    sum -= a[l] + b[l];
    f -= b[l];
  }
  printf("%d\n", ans);
  return 0;
}
