#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e+9;
int main() {
  int n, k;
  cin >> n >> k;
  multiset<pair<int, int>> s;
  int x;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    s.insert(make_pair(x, i));
  }
  int cmin, min = s.rbegin()->first - s.begin()->first, kk = 0;
  vector<pair<int, int>> ans;
  vector<pair<int, int>> cans;
  for (int i = 1; i <= k; i++) {
    cans.push_back(make_pair(s.rbegin()->second, s.begin()->second));
    x = s.rbegin()->first - 1;
    multiset<pair<int, int>>::iterator it = s.end();
    it--;
    s.erase(it);
    s.insert(make_pair(x, cans.rbegin()->first));
    x = s.begin()->first + 1;
    it = s.begin();
    s.erase(it);
    s.insert(make_pair(x, cans.rbegin()->second));
    cmin = s.rbegin()->first - s.begin()->first;
    if (cmin < min) {
      min = cmin;
      kk = i;
      ans = cans;
    }
  }
  cout << min << " " << kk << endl;
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i].first << " " << ans[i].second << endl;
  }
  return 0;
}
