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 mod = 1000000007;
long long mod2 = 998244353;
long long mod3 = 1000003;
long long mod4 = 998244853;
long long mod5 = 1000000009;
long long inf = 1LL << 62;
int iinf = 1 << 30;
double pi = 3.141592653589793238462643383279L;
double eps = 1e-14;
int dh[4] = {1, -1, 0, 0};
int dw[4] = {0, 0, 1, -1};
int ddh[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
int ddw[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  if (b == 0) return a;
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
  long long c = gcd(a, b);
  return a * b / c;
}
long long Pow(long long n, long long k) {
  long long ret = 1;
  long long now = n;
  while (k > 0) {
    if (k & 1) ret *= now;
    now *= now;
    k /= 2;
  }
  return ret;
}
long long beki(long long n, long long k, long long md) {
  long long ret = 1;
  long long now = n;
  now %= md;
  while (k > 0) {
    if (k % 2 == 1) {
      ret *= now;
      ret %= md;
    }
    now *= now;
    now %= md;
    k /= 2;
  }
  return ret;
}
long long gyaku(long long n, long long md) { return beki(n, md - 2, md); }
long long poc(long long n) {
  long long ret = 0;
  long long u = n;
  while (u > 0) {
    ret += u % 2;
    u /= 2;
  }
  return ret;
}
struct MaST {
 private:
  long long n;
  vector<pair<long long, long long> > dat;

 public:
  MaST(vector<long long> v) {
    long long sz = v.size();
    n = 1;
    while (n < sz) n *= 2;
    pair<long long, long long> p = {-inf, -inf};
    dat.resize(2 * n - 1, p);
    for (long long i = 0; i < sz; i++) dat[i + n - 1] = {v[i], i};
    for (long long i = n - 2; i >= 0; i--) {
      dat[i] = max(dat[i * 2 + 1], dat[i * 2 + 2]);
    }
  }
  void add(long long k, long long x) {
    long long i = k + n - 1;
    dat[i] = {x, k};
    while (i > 0) {
      i = (i - 1) / 2;
      dat[i] = max(dat[2 * i + 1], dat[2 * i + 2]);
    }
  }
  pair<long long, long long> que(long long a, long long b, long long k = 0,
                                 long long l = 0, long long r = -1) {
    if (r < 0) r = n;
    if (b <= l || a >= r) return {-inf, -inf};
    if (a <= l && b >= r) return dat[k];
    pair<long long, long long> m1 = que(a, b, 2 * k + 1, l, (l + r) / 2);
    pair<long long, long long> m2 = que(a, b, 2 * k + 2, (l + r) / 2, r);
    return max(m1, m2);
  }
};
vector<long long> sum(300010), sum2(300010);
long long d[300010], c[300010];
MaST seg(vector<long long>(300010, -inf)),
    seg2(vector<long long>(300010, -inf));
long long ans = 0;
long long f(long long l, long long r) {
  if (r - l == 1) {
    return c[l];
  }
  long long num = -1;
  long long ma = -1;
  for (long long i = l + 1; i < r; i++) {
    if ((d[i] - d[i - 1]) * (d[i] - d[i - 1]) > ma) {
      num = i;
      ma = (d[i] - d[i - 1]) * (d[i] - d[i - 1]);
    }
  }
  long long ret = 0;
  pair<long long, long long> p = seg.que(num + 1, r + 1);
  ret = p.first - sum[num];
  p = seg2.que(l, num);
  ret += p.first - sum2[num];
  ret -= ma;
  ret = max(ret, f(l, num));
  ret = max(ret, f(num, r));
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, a;
  cin >> n >> a;
  sum[0] = 0;
  for (long long i = 0; i < n; i++) {
    cin >> d[i] >> c[i];
    c[i] = a - c[i];
    sum[i + 1] = sum[i] + c[i];
  }
  sum2[n] = 0;
  for (long long i = n - 1; i >= 0; i--) sum2[i] = sum2[i + 1] + c[i];
  for (long long i = 0; i < n + 1; i++) {
    seg.add(i, sum[i]);
    seg2.add(i, sum2[i]);
  }
  ans = max(ans, f(0, n));
  cout << ans << endl;
}
