#include <bits/stdc++.h>
using namespace std;
int n, m, a[200005], l[200005], r[200005], ans, sum, _l = 1, tmp;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%d%d", l + i, r + i);
  ans = tmp = r[1] - l[1];
  for (int i = 2; i <= n; ++i) {
    sum += l[i] - r[i - 1];
    tmp += r[i] - l[i];
    while (sum >= m) sum -= l[_l + 1] - r[_l], tmp -= r[_l] - l[_l], ++_l;
    ans = max(tmp, ans);
  }
  printf("%d\n", ans + m);
  return 0;
}
