#include <bits/stdc++.h>
using namespace std;
void upd(long long, long long, long long, long long, long long, long long);
long long tr[1200555], up[1200555];
long long n, a, max_ = 0, ans[300005];
pair<long long, long long> ar[300005];
stack<pair<long long, long long> > st;
int main() {
  scanf("%lld %lld", &n, &a);
  for (int i = 0; i < n; i++) {
    scanf("%lld %lld", &ar[i].first, &ar[i].second);
  }
  for (int i = n - 1; i >= 0; i--) {
    long long dd = ar[i].first, cc = ar[i].second;
    upd(0, 0, n - 1, i, n, a - cc);
    long long sqr = (ar[i + 1].first - ar[i].first) *
                    (ar[i + 1].first - ar[i].first),
              last = i + 1;
    st.push(make_pair(0, i + 1));
    while (!st.empty() && (st.top()).first < sqr) {
      long long val = (st.top()).first;
      long long pre = (st.top()).second;
      upd(0, 0, n - 1, last, pre, -(sqr - val));
      st.pop();
      last = pre + 1;
    }
    st.push(make_pair(sqr, last - 1));
    ans[i] = max(0ll, tr[0]);
    max_ = max(max_, ans[i]);
  }
  cout << max_;
}
void upd(long long idx, long long l, long long r, long long low, long long high,
         long long x) {
  if (up[idx] != 0) {
    tr[idx] = tr[idx] + up[idx];
    if (l != r) {
      up[2 * idx + 1] = up[2 * idx + 1] + up[idx];
      up[2 * idx + 2] = up[2 * idx + 2] + up[idx];
    }
    up[idx] = 0;
  }
  if (low <= l && r <= high) {
    tr[idx] = tr[idx] + x;
    if (l != r) {
      up[2 * idx + 1] = up[2 * idx + 1] + x;
      up[2 * idx + 2] = up[2 * idx + 2] + x;
    }
    return;
  }
  if (r < low || high < l) return;
  long long mid = (l + r) / 2;
  upd(2 * idx + 1, l, mid, low, high, x);
  upd(2 * idx + 2, mid + 1, r, low, high, x);
  tr[idx] = max(tr[2 * idx + 1], tr[2 * idx + 2]);
}
