Vasya got really tired of these credits (from problem F) and now wants to earn the money himself! He decided to make a contest to gain a profit.

Vasya has n problems to choose from. They are numbered from 1 to n. The difficulty of the i-th problem is d_i. Moreover, the problems are given in the increasing order by their difficulties. The difficulties of all tasks are pairwise distinct. In order to add the i-th problem to the contest you need to pay c_i burles to its author. For each problem in the contest Vasya gets a burles.

In order to create a contest he needs to choose a consecutive subsegment of tasks.

So the total earnings for the contest are calculated as follows: 

  * if Vasya takes problem i to the contest, he needs to pay c_i to its author; 
  * for each problem in the contest Vasya gets a burles; 
  * let gap(l, r) = max_{l ≤ i < r} (d_{i + 1} - d_i)^2. If Vasya takes all the tasks with indices from l to r to the contest, he also needs to pay gap(l, r). If l = r then gap(l, r) = 0. 



Calculate the maximum profit that Vasya can earn by taking a consecutive segment of tasks.

Input

The first line contains two integers n and a (1 ≤ n ≤ 3 ⋅ 10^5, 1 ≤ a ≤ 10^9) — the number of proposed tasks and the profit for a single problem, respectively.

Each of the next n lines contains two integers d_i and c_i (1 ≤ d_i, c_i ≤ 10^9, d_i < d_{i+1}).

Output

Print one integer — maximum amount of burles Vasya can earn.

Examples

Input


5 10
1 15
5 3
6 11
7 2
11 22


Output


13


Input


3 5
1 8
2 19
3 11


Output


0
#include <bits/stdc++.h>
using namespace std;
template <typename S, typename T>
ostream& operator<<(ostream& out, pair<S, T> const& p) {
  out << '(' << p.first << ", " << p.second << ')';
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T> const& v) {
  long long l = v.size();
  for (long long i = 0; i < l - 1; i++) out << v[i] << ' ';
  if (l > 0) out << v[l - 1];
  return out;
}
template <typename T>
void trace(const char* name, T&& arg1) {
  cout << name << " : " << arg1 << "\n";
}
template <typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  trace(comma + 1, args...);
}
const long long N = 300000 + 20;
struct data1 {
  long long mini, maxi;
};
data1 seg_tree[4 * N];
long long d[N], c[N];
long long n, a;
long long pref[N];
data1 combine(data1 l, data1 r) {
  data1 res;
  res.mini = min(l.mini, r.mini);
  res.maxi = max(l.maxi, r.maxi);
  return res;
}
void build(long long v, long long l, long long r) {
  if (l == r) {
    seg_tree[v].mini = pref[l];
    seg_tree[v].maxi = pref[l];
    return;
  }
  long long m = (l + r) / 2;
  build(2 * v, l, m);
  build(2 * v + 1, m + 1, r);
  seg_tree[v] = combine(seg_tree[2 * v], seg_tree[2 * v + 1]);
  return;
}
data1 query(long long v, long long l, long long r, long long ql, long long qr) {
  if (ql > qr) {
    data1 ans;
    ans.mini = 1000000000000000001;
    ans.maxi = -1000000000000000001;
    return ans;
  }
  if (ql == l and qr == r) {
    return seg_tree[v];
  }
  long long m = (l + r) / 2;
  return combine(query(2 * v, l, m, ql, min(qr, m)),
                 query(2 * v + 1, m + 1, r, max(ql, m + 1), qr));
}
long long RMQ[20][N];
long long floorlog[N];
long long dp[N];
void precompute() {
  for (long long i = 0; (1 << i) < N; i++) {
    for (long long j = (1 << i); j < N && j < (1 << (i + 1)); j++)
      floorlog[j] = i;
  }
  for (long long i = n; i >= 1; i--) {
    RMQ[0][i] = dp[i];
    long long mxj = floorlog[n - i + 1];
    long long pw = 1;
    for (long long j = 1; j <= mxj; j++) {
      RMQ[j][i] = max(RMQ[j - 1][i], RMQ[j - 1][i + pw]);
      pw <<= 1;
    }
  }
}
long long getMax(long long L, long long R) {
  long long k = floorlog[R - L + 1];
  return max(RMQ[k][L], RMQ[k][R - (1 << k) + 1]);
}
void solve() {
  cin >> n >> a;
  for (long long i = 0; i < n; i++) cin >> d[i + 1] >> c[i + 1];
  pref[0] = 0;
  for (long long i = 1; i <= n; i++) pref[i] = pref[i - 1] + a - c[i];
  for (long long i = 2; i <= n; i++)
    dp[i] = (d[i] - d[i - 1]) * (d[i] - d[i - 1]);
  precompute();
  build(1, 0, n);
  long long ans = -1000000000000000001;
  for (long long i = 1; i <= n; i++) {
    ans = max(ans, a - c[i]);
    if (i == 1) continue;
    long long curr = dp[i];
    long long l = i, r = n + 1;
    while (l + 1 < r) {
      long long mid = (l + r) / 2;
      if (getMax(i, mid) == curr)
        l = mid;
      else
        r = mid;
    }
    long long hi = l;
    l = 1, r = i;
    while (l + 1 < r) {
      long long mid = (l + r) / 2;
      if (getMax(mid, i) == curr)
        r = mid;
      else
        l = mid;
    }
    long long lo = r - 1;
    auto d1 = query(1, 0, n, i, hi);
    auto d2 = query(1, 0, n, lo - 1, i - 2);
    ans = max(ans, d1.maxi - d2.mini - curr);
  }
  cout << max(ans, 0LL) << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  t = 1;
  while (t--) solve();
}
