Little D is a friend of Little C who loves intervals very much instead of number "3".

Now he has n intervals on the number axis, the i-th of which is [a_i,b_i].

Only the n intervals can not satisfy him. He defines the value of an interval of intervals [l,r] (1 ≤ l ≤ r ≤ n, l and r are both integers) as the total length of the union of intervals from the l-th to the r-th.

He wants to select exactly k different intervals of intervals such that the sum of their values is maximal. Please help him calculate the maximal sum.

Input

First line contains two integers n and k (1 ≤ n ≤ 3 ⋅ 10^5, 1 ≤ k ≤ min\{(n(n+1))/(2),10^9\}) — the number of intervals Little D has and the number of intervals of intervals he will select.

Each of the next n lines contains two integers a_i and b_i, the i-th line of the n lines describing the i-th interval (1 ≤ a_i < b_i ≤ 10^9).

Output

Print one integer — the maximal sum of values Little D can get.

Examples

Input

2 1
1 3
2 4


Output

3

Input

3 3
1 4
5 7
3 6


Output

15

Note

For the first example, Little D will select [1,2], the union of the first interval and the second interval is [1,4], whose length is 3.

For the second example, Little D will select [1,2], [2,3] and [1,3], the answer is 5+6+4=15.
#include <bits/stdc++.h>
using namespace std;
const int maxn = 300005;
set<pair<int, int> > st;
set<pair<int, int> >::iterator it, tt;
vector<pair<int, int> > v[maxn];
int n, m, f[maxn];
int main() {
  int x, X;
  scanf("%d%d", &n, &m);
  st.insert(make_pair(1, 0));
  st.insert(make_pair(1e9, 0));
  for (int i = 1; i <= n; ++i) {
    int l, r;
    scanf("%d%d", &l, &r);
    tt = (it = st.upper_bound(make_pair(l, n)))--;
    v[i].push_back(make_pair(x = it->second, it->first - tt->first));
    if (it->first < l)
      v[i].push_back(make_pair(x, l - it->first));
    else
      st.erase(it);
    v[i].push_back(make_pair(i, r - l));
    st.insert(make_pair(l, i));
    while (tt->first < r)
      it = tt++,
      v[i].push_back(make_pair(x = it->second, it->first - tt->first)),
      st.erase(it);
    if (tt->first > r)
      v[i].push_back(make_pair(x, tt->first - r)), st.insert(make_pair(r, x));
  }
  long long s1, s2, S1, S2, t1, t2;
  for (int l = 1, r = 1e9; l <= r;) {
    x = l + r >> 1;
    memset(f, 0, sizeof(f));
    s1 = s2 = t1 = t2 = 0;
    for (int i = 1, j = 1; i <= n; ++i) {
      for (int k = 0; k < v[i].size(); ++k)
        if (v[i][k].first < j)
          t1 += (long long)v[i][k].first * v[i][k].second;
        else
          t1 += (long long)(j - 1) * v[i][k].second, t2 += v[i][k].second,
              f[v[i][k].first] += v[i][k].second;
      while (j <= i && t2 >= x) t1 += t2, t2 -= f[j++];
      s1 += t1;
      s2 += j - 1;
    }
    if (s2 >= m)
      X = x, S1 = s1, S2 = s2, l = x + 1;
    else
      r = x - 1;
  }
  printf("%lld", S1 - (S2 - m) * X);
  return 0;
}
