Another semester has ended and Arthur finally achieved his dream of attending Data Structures I with all professors in the Mathematics Department. Now, he can finally pass this subject, but, like everyone expected, he didn't do any PAs (programming assignments), and all deadlines have passed.
Fortunately, all PAs can still be submitted for grading, but with a penalty given by: _(late submission time) - (expected deadline time)_ for each PA.
Arthur, having taken Data Structures I so many times, knows exactly how much time he needs to complete each assignment. Now, he wants to write a program that determines the minimum sum of penalties that can be achieved, given he can do the PAs in any order.
It's worth noting that Arthur can't do more than one assignment at a time, since that skill is only learned in Data Structures II. Therefore, if Arthur starts working on an assignment, he needs to finish it before starting any other.
There is only one problem left: Arthur believes this problem to be unsettlingly similar to a PA, and, therefore, refuses to do it.
Help Arthur complete this task and, finally, take Data Structures II.
The first line of input contains two integers 1 ≤ n ≤ 105 and 1 ≤ s ≤ 109, the amount of PAs Arthur needs to do and the time when he started to do them, respectively.
n lines follow, the i-th line contains two integers 1 ≤ ti ≤ 109 and 0 ≤ ei ≤ 109, the time Arthur takes to complete the i-th assignment and the expected deadline time for that assignment.
It is guaranteed s > ei for all i.
Print the sum of all penalties if Arthur completes the PAs in the optimal order.
In the first example, if Arthur does the second PA first, he finishes it at time 2, and finishes the first one at time 4, making his total penalty equals to (2-0)+(4-0) = 6.
## Input
The first line of input contains two integers 1 ≤ n ≤ 105 and 1 ≤ s ≤ 109, the amount of PAs Arthur needs to do and the time when he started to do them, respectively.n lines follow, the i-th line contains two integers 1 ≤ ti ≤ 109 and 0 ≤ ei ≤ 109, the time Arthur takes to complete the i-th assignment and the expected deadline time for that assignment.It is guaranteed s > ei for all i.
## Output
Print the sum of all penalties if Arthur completes the PAs in the optimal order.
[samples]
## Note
In the first example, if Arthur does the second PA first, he finishes it at time 2, and finishes the first one at time 4, making his total penalty equals to (2-0)+(4-0) = 6.
**Definitions**
Let $ n \in \mathbb{Z}^+ $ be the number of programming assignments.
Let $ s \in \mathbb{Z}^+ $ be the start time.
For each assignment $ i \in \{1, \dots, n\} $:
- Let $ t_i \in \mathbb{Z}^+ $ be the time required to complete assignment $ i $.
- Let $ e_i \in \mathbb{Z}_{\geq 0} $ be the deadline for assignment $ i $.
It is given that $ s > e_i $ for all $ i $.
**Constraints**
1. $ 1 \leq n \leq 10^5 $
2. $ 1 \leq s \leq 10^9 $
3. $ 1 \leq t_i \leq 10^9 $ for all $ i $
4. $ 0 \leq e_i \leq 10^9 $ for all $ i $
5. $ s > e_i $ for all $ i $
**Objective**
Determine the permutation $ \sigma \in S_n $ that minimizes the total penalty:
$$
\sum_{i=1}^n \left( \left(s + \sum_{j=1}^i t_{\sigma(j)} \right) - e_{\sigma(i)} \right)
$$
Equivalently, minimize:
$$
\sum_{i=1}^n \left( s + \sum_{j=1}^i t_{\sigma(j)} - e_{\sigma(i)} \right)
= n \cdot s + \sum_{i=1}^n (n - i + 1) \cdot t_{\sigma(i)} - \sum_{i=1}^n e_{\sigma(i)}
$$
Since $ \sum_{i=1}^n e_{\sigma(i)} = \sum_{i=1}^n e_i $ is constant, minimize:
$$
n \cdot s + \sum_{i=1}^n (n - i + 1) \cdot t_{\sigma(i)}
$$
This is equivalent to minimizing $ \sum_{i=1}^n (n - i + 1) \cdot t_{\sigma(i)} $, which is achieved by sorting assignments in **decreasing order of $ t_i $** (i.e., longest task first).
**Optimal Order:**
Sort assignments by $ t_i $ in descending order.
**Final Objective:**
Compute:
$$
\sum_{i=1}^n \left( s + \sum_{j=1}^i t_{\sigma(j)} - e_{\sigma(i)} \right)
$$
where $ \sigma $ is the permutation sorting $ t_i $ in descending order.