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;
long long d[400000], c[400000];
template <class T>
struct RMQ {
  pair<T, int> dat[2 * (1 << 19)];
  T inf;
  function<pair<T, int>(pair<T, int>, pair<T, int>)> merge;
  void init(T Inf, function<pair<T, int>(pair<T, int>, pair<T, int>)> Merge) {
    inf = Inf;
    merge = Merge;
    for (int i = 0; i < (2 * (1 << 19) - 1); i++) {
      dat[i].first = inf;
      if (i >= (1 << 19) - 1) dat[i].second = i - (1 << 19) + 1;
    }
  }
  void update(int k, T x) {
    k += (1 << 19) - 1;
    dat[k].first = x;
    while (k) {
      k = (k - 1) / 2;
      dat[k] = merge(dat[k * 2 + 1], dat[k * 2 + 2]);
    }
  }
  pair<T, int> query(int a, int b, int k = 0, int l = 0, int r = (1 << 19)) {
    if (b <= l || r <= a) return make_pair(inf, -1);
    if (a <= l && r <= b) return dat[k];
    auto lb = query(a, b, k * 2 + 1, l, (l + r) / 2);
    auto rb = query(a, b, k * 2 + 2, (l + r) / 2, r);
    return merge(lb, rb);
  }
  T getValue(int a, int b) { return query(a, b).first; }
  int getIndex(int a, int b) { return query(a, b).second; }
};
template <class T>
pair<T, int> RangeMax(pair<T, int> a, pair<T, int> b) {
  return a.first >= b.first ? a : b;
}
template <class T>
pair<T, int> RangeMin(pair<T, int> a, pair<T, int> b) {
  return a.first <= b.first ? a : b;
}
RMQ<long long> seg1;
RMQ<long long> seg2;
RMQ<long long> seg3;
long long ans = 0;
void dfs(int l, int r) {
  if (r - l <= 1) return;
  auto p = seg1.query(l, r - 1);
  int id = p.second;
  dfs(l, id + 1);
  dfs(id + 1, r);
  long long Min = seg2.getValue(l - 1, id + 1);
  long long Max = seg3.getValue(id + 1, r);
  ans = max(ans, Max - Min - p.first);
}
long long sum[400000];
int main() {
  int n, a;
  cin >> n >> a;
  for (int i = 0; i < (n); i++) {
    scanf("%lld%lld", &d[i], &c[i]);
    c[i] = a - c[i];
    ans = max(ans, c[i]);
  }
  seg1.init(0, RangeMax<long long>);
  seg2.init(LLONG_MAX, RangeMin<long long>);
  seg3.init(LLONG_MIN, RangeMax<long long>);
  for (int i = 0; i < (n - 1); i++) {
    seg1.update(i + 1, (d[i + 1] - d[i]) * (d[i + 1] - d[i]));
  }
  sum[0] = 0;
  seg2.update(0, 0);
  seg3.update(0, 0);
  for (int i = 1; i <= n; i++) {
    sum[i] = sum[i - 1] + c[i - 1];
    seg2.update(i, sum[i]);
    seg3.update(i, sum[i]);
  }
  dfs(1, n + 1);
  cout << ans << endl;
}
