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
import static java.lang.Math.*;
// import java.math.BigInteger;
import java.io.*;
import java.util.*;

// solution code is in solve()

public class Profit {
    final static long mod = 1_000_000_007l;
    final static int maxn = 1_000_007;
    final static long infty = 1_000_000_009l;

    // final static boolean DEBUG = true;
    final static boolean DEBUG = false;

    static class Solver {

        final static Soln dummy = new Soln(0, 0, 0, 0);

        static class Soln {
            long best;
            long sum; 
            long pref; 
            long suf;

            Soln(long v) {
                sum = v;
                if (v >= 0) {
                    best = pref = suf = v;
                } else {
                    best = pref = suf = 0;
                }
            }

            Soln(long sum, long best, long pref, long suf) {
                this.sum = sum; this.best = best; this.pref = pref; this.suf = suf;
            }

            Soln join(Soln oth) {
                long sum = this.sum + oth.sum;
                long best = max(this.best, oth.best); best = max(best, this.suf + oth.pref);
                long pref = max(this.pref, this.sum + oth.pref);
                long suf = max(oth.suf, oth.sum + this.suf);
                return new Soln(sum, best, pref, suf);
            }
        }

        long[] A;
        long[] Q;
        long[] D;
        Soln[] S;
        int[] dsu;
        int[] left;
        int[] right;
        Integer[] order;
        boolean[] added;
        int n;

        public void solve() {
            n = in.gi(); long bias = in.gl();
            A = new long[n + 1];
            S = new Soln[n + n + n + n + 5];
            D = new long[n + 1];
            Q = new long[n + 1];
            added = new boolean[n + 1];
            order = new Integer[n + 1];
            dsu = new int[n + 1];
            left = new int[n + 1];
            right = new int[n + 1];

            long ans = 0l, bestsub = 0l;

            for (int j = 1; j <= n; j++) {
                order[j] = j;
                dsu[j] = -1;
                left[j] = right[j] = j;
                D[j] = in.gl();
                A[j] = bias - in.gl(); 
                
                debug(j, " : ", A[j]);
                
                ans = max(ans, A[j]);
                Q[j] = (D[j] - D[j - 1]) * (D[j] - D[j - 1]);
                if (j == 1) Q[j] = infty * infty; 
            }

            bestsub = ans;

            build(1, 1, n);

            Arrays.sort(order, 1, n + 1, (x, y) -> Long.valueOf(Q[x]).compareTo(Q[y]));

            verify(order[n] == 1);

            for (int j = 1; j < n; j++) { 
                int x = order[j];
                long cur = Q[x];
                added[x] = true;

                debug(x, " = ", cur);

                if (x - 1 >= 1 && added[x - 1]) unionS(findS(x - 1), findS(x));
                if (x + 1 <= n && added[x + 1]) unionS(findS(x + 1), findS(x));
                int y = findS(x);
                int l = left[y], r = right[y];

                debug(" ? : ", l, " .. ", r);
                
                bestsub = max(bestsub, qry(l - 1, r));
                ans = max(ans, bestsub - cur);
            }

            println(ans);
        }

        void unionS(int x, int y) {
            left[x] = min(left[x], left[y]);
            right[x] = max(right[x], right[y]);
            dsu[y] = x;
        }

        int findS(int x) {
            if (dsu[x] < 0) return x;
            dsu[x] = findS(dsu[x]);
            return dsu[x];
        }

        void build(int x, int l, int r) {
            if (l == r) {
                S[x] = new Soln(A[l]);
                return;
            }

            int m = (l + r) / 2;
            build(x + x, l, m); build(x + x + 1, m + 1, r);
            S[x] = S[x + x].join(S[x + x + 1]);
        }

        Soln query(int x, int l, int r, int i, int j) {
            if (j < l || r < i) return dummy;

            if (i <= l && r <= j) return S[x];

            int m = (l + r) / 2;

            return query(x + x, l, m, i, j).join(query(x + x + 1, m + 1, r, i, j));
        }

        long qry(int l, int r) {
            return query(1, 1, n, l, r).best;
        }



        PrintWriter out;
        FastInput in;
        Random random_source;

        long modexp(long x, long ex) {
            long ans = 1l;
            for (; ex > 0; ex >>= 1l, x = (x * x) % mod) {
                if ((ex & (1l)) > 0) ans = (ans * x) % mod;
            }
            return ans;
        }

        long gcd(long x, long y) {
            while (y > 0) {
                long t = x % y;
                x = y; y = t;
            }
            return x;
        }

        // Random numbers

        void initRandom(Long x) {
            random_source = new Random(x);
        }

        void initRandom() {
            random_source = new Random(System.currentTimeMillis());
        }

        int rand(int bound) { // [0..bound)
            return random_source.nextInt(bound);
        }

        // Convenience functions

        void debug(Object... obj) {
            if (DEBUG) {
                out.print("# ");
                for (Object o : obj) {
                    out.print(o.toString());
                    out.print(" ");
                }
                out.println("");
                out.flush();
            }
        }

       
        String a2s(Object[] A) {
            return Arrays.toString(A);
        }

        String a2s(int[] A) {
            return Arrays.toString(A);
        }

        String a2s(long[] A) {
            return Arrays.toString(A);
        }


        void flush() {
            out.flush();
        }

        void print(Object... obj) {
            for (Object o : obj) {
                out.print(o.toString());
            }
        }

        void println(Object... obj) {
            for (Object o : obj) {
                out.print(o.toString());
            }
            out.println("");
        } 

        void verify(boolean check) {    // equivalent to assert
            if (!check) {
                throw new RuntimeException("Verification error");
            }
        }

        void reverse(long[] A, int l, int r) {
            int i = l, j = r - 1;
            while (i < j) {
                long t = A[i];
                A[i] = A[j];
                A[j] = t;
                i++; j--;
            }
        }

        void reverse(int[] A, int l, int r) {
            int i = l, j = r - 1;
            while (i < j) {
                int t = A[i];
                A[i] = A[j];
                A[j] = t;
                i++; j--;
            }
        }

        // Measure time 

        long initTime;

        public void startWatch() {
            if (DEBUG) {
                initTime = System.nanoTime();
            }
        }

        public void endWatch() {
            if (DEBUG) {
                long current = System.nanoTime();
                long diff = current - initTime;
                long memory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
                println("(Time: ", (double)diff / 1e9, ", Memory: ", memory/1000, "K)");            
            }
        }

        // Solver class constructor

        Solver(PrintWriter out, FastInput in) {
            this.out = out; this.in = in;
        }
    }

    public static void main(String args[]) {
        FastInput in = new FastInput(System.in);
        PrintWriter out = new PrintWriter(System.out);
        Solver solver = new Solver(out, in);
        solver.startWatch();
        solver.solve();
        solver.endWatch();
        out.close();
    }
    
    static class FastInput {
        BufferedReader reader;
        StringTokenizer tok;

        public FastInput(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tok = null;
        }

        public String next() {
            while (tok == null || !tok.hasMoreTokens()) {
                try {
                    tok = new StringTokenizer(reader.readLine());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            return tok.nextToken();
        }

        public int gi() {
            return Integer.parseInt(next());
        }

        public long gl() {
            return Long.parseLong(next());
        }
    }

    static class Pair<A extends Comparable<A>, B extends Comparable<B>>
            implements Comparable<Pair<A, B>> {
        A F;
        B S;

        Pair(A x, B y) {
            F = x; S = y;
        }

        public boolean equals(Pair<A, B> oth) {
            return this.compareTo(oth) == 0;    
        }

        public int compareTo(Pair<A, B> Q) {
            if (this.F.compareTo(Q.F) == 0) {
                return this.S.compareTo(Q.S);
            } else {
                return this.F.compareTo(Q.F);
            }
        }

        public String toString() {
            return new StringBuilder("{")
                    .append(F.toString())
                    .append(", ")
                    .append(S.toString())
                    .append("}")
                    .toString();
        }
    }

    static class LongPair implements Comparable<LongPair>{
        Long F;
        Long S;

        LongPair(Long x, Long y) {
            F = x; S = y;
        }

        public boolean equals(LongPair oth) {
            return this.compareTo(oth) == 0;    
        }

        public int compareTo(LongPair Q) {
            if (this.F.compareTo(Q.F) == 0) {
                return this.S.compareTo(Q.S);
            } else {
                return this.F.compareTo(Q.F);
            }
        }

        public String toString() {
            return new StringBuilder("{")
                    .append(F.toString())
                    .append(", ")
                    .append(S.toString())
                    .append("}")
                    .toString();
        }
    }
}
