#include <bits/stdc++.h>
using namespace std;
int M = 1e9 + 7;
int dd = 33;
int sp[3000001];
int max(int x, int y) {
  if (x > y) return x;
  return y;
}
int power(int x, int y) {
  if (y == 0) return 1;
  int t = power(x, y / 2);
  t = ((t) * (t));
  if (y % 2 == 1) t = ((t) * (x));
  return t;
}
int min(int x, int y) {
  if (x < y) return x;
  return y;
}
int dfs(vector<int> tree[], int n, int s, int p, int dp[]) {
  int c = 0;
  int i;
  int mx = 0;
  for (i = 0; i < tree[s].size(); i++) {
    if (tree[s][i] != p) {
      int f = 0;
      f = dfs(tree, n, tree[s][i], s, dp);
      c += f;
      mx = max(mx, f);
    }
  }
  mx = max(mx, n - c - 1);
  c++;
  dp[s] = mx;
  return c;
}
int check(vector<int>& v1, vector<int>& v2, int ind, int m) {
  int x = v2[0] - v1[ind];
  if (x < 0) x += m;
  int t = ind;
  for (int i = 0; i < v2.size(); i++) {
    int d = v2[i] - v1[t];
    if (d < 0) d += m;
    if (d != x) return -1;
    t++;
    t = t % (v1.size());
  }
  return x;
}
void output() {
  int n, m;
  cin >> n >> m;
  int a[n], i;
  map<int, bool> mpp;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    mpp[a[i]] = true;
  }
  sort(a, a + n);
  vector<int> b;
  map<int, int> dist;
  queue<int> pq;
  for (i = 0; i < n; i++) {
    if (mpp[a[i] - 1] == false) {
      pq.push(a[i] - 1);
      dist[a[i] - 1] = 1;
      mpp[a[i] - 1] = true;
    }
    if (mpp[a[i] + 1] == false) {
      pq.push(a[i] + 1);
      dist[a[i] + 1] = 1;
      mpp[a[i] + 1] = true;
    }
  }
  long long s = 0;
  while (!pq.empty() && b.size() != m) {
    int p = pq.front();
    pq.pop();
    b.push_back(p);
    s += dist[p];
    if (!mpp[p + 1]) {
      pq.push(p + 1);
      dist[p + 1] = dist[p] + 1;
      mpp[p + 1] = true;
    }
    if (!mpp[p - 1]) {
      pq.push(p - 1);
      dist[p - 1] = dist[p] + 1;
      mpp[p - 1] = true;
    }
  }
  cout << s << endl;
  for (i = 0; i < b.size(); i++) cout << b[i] << " ";
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  t = 1;
  int i;
  while (t--) output();
}

### Prompt

Construct a CPP code solution to the problem outlined:

There are n Christmas trees on an infinite number line. The i-th tree grows at the position x_i. All x_i are guaranteed to be distinct.

Each integer point can be either occupied by the Christmas tree, by the human or not occupied at all. Non-integer points cannot be occupied by anything.

There are m people who want to celebrate Christmas. Let y_1, y_2, ..., y_m be the positions of people (note that all values x_1, x_2, ..., x_n, y_1, y_2, ..., y_m should be distinct and all y_j should be integer). You want to find such an arrangement of people that the value ∑_{j=1}^{m}min_{i=1}^{n}|x_i - y_j| is the minimum possible (in other words, the sum of distances to the nearest Christmas tree for all people should be minimized).

In other words, let d_j be the distance from the j-th human to the nearest Christmas tree (d_j = min_{i=1}^{n} |y_j - x_i|). Then you need to choose such positions y_1, y_2, ..., y_m that ∑_{j=1}^{m} d_j is the minimum possible.

Input

The first line of the input contains two integers n and m (1 ≤ n, m ≤ 2 ⋅ 10^5) — the number of Christmas trees and the number of people.

The second line of the input contains n integers x_1, x_2, ..., x_n (-10^9 ≤ x_i ≤ 10^9), where x_i is the position of the i-th Christmas tree. It is guaranteed that all x_i are distinct.

Output

In the first line print one integer res — the minimum possible value of ∑_{j=1}^{m}min_{i=1}^{n}|x_i - y_j| (in other words, the sum of distances to the nearest Christmas tree for all people).

In the second line print m integers y_1, y_2, ..., y_m (-2 ⋅ 10^9 ≤ y_j ≤ 2 ⋅ 10^9), where y_j is the position of the j-th human. All y_j should be distinct and all values x_1, x_2, ..., x_n, y_1, y_2, ..., y_m should be distinct.

If there are multiple answers, print any of them.

Examples

Input


2 6
1 5


Output


8
-1 2 6 4 0 3 


Input


3 5
0 3 1


Output


7
5 -2 4 -1 2 

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
int M = 1e9 + 7;
int dd = 33;
int sp[3000001];
int max(int x, int y) {
  if (x > y) return x;
  return y;
}
int power(int x, int y) {
  if (y == 0) return 1;
  int t = power(x, y / 2);
  t = ((t) * (t));
  if (y % 2 == 1) t = ((t) * (x));
  return t;
}
int min(int x, int y) {
  if (x < y) return x;
  return y;
}
int dfs(vector<int> tree[], int n, int s, int p, int dp[]) {
  int c = 0;
  int i;
  int mx = 0;
  for (i = 0; i < tree[s].size(); i++) {
    if (tree[s][i] != p) {
      int f = 0;
      f = dfs(tree, n, tree[s][i], s, dp);
      c += f;
      mx = max(mx, f);
    }
  }
  mx = max(mx, n - c - 1);
  c++;
  dp[s] = mx;
  return c;
}
int check(vector<int>& v1, vector<int>& v2, int ind, int m) {
  int x = v2[0] - v1[ind];
  if (x < 0) x += m;
  int t = ind;
  for (int i = 0; i < v2.size(); i++) {
    int d = v2[i] - v1[t];
    if (d < 0) d += m;
    if (d != x) return -1;
    t++;
    t = t % (v1.size());
  }
  return x;
}
void output() {
  int n, m;
  cin >> n >> m;
  int a[n], i;
  map<int, bool> mpp;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    mpp[a[i]] = true;
  }
  sort(a, a + n);
  vector<int> b;
  map<int, int> dist;
  queue<int> pq;
  for (i = 0; i < n; i++) {
    if (mpp[a[i] - 1] == false) {
      pq.push(a[i] - 1);
      dist[a[i] - 1] = 1;
      mpp[a[i] - 1] = true;
    }
    if (mpp[a[i] + 1] == false) {
      pq.push(a[i] + 1);
      dist[a[i] + 1] = 1;
      mpp[a[i] + 1] = true;
    }
  }
  long long s = 0;
  while (!pq.empty() && b.size() != m) {
    int p = pq.front();
    pq.pop();
    b.push_back(p);
    s += dist[p];
    if (!mpp[p + 1]) {
      pq.push(p + 1);
      dist[p + 1] = dist[p] + 1;
      mpp[p + 1] = true;
    }
    if (!mpp[p - 1]) {
      pq.push(p - 1);
      dist[p - 1] = dist[p] + 1;
      mpp[p - 1] = true;
    }
  }
  cout << s << endl;
  for (i = 0; i < b.size(); i++) cout << b[i] << " ";
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  t = 1;
  int i;
  while (t--) output();
}

```