#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using ii = pair<int, int>;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, k, x;
  cin >> n >> k;
  priority_queue<ii, vector<ii>> p;
  priority_queue<ii, vector<ii>, greater<ii>> q;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    p.emplace(x, i);
    q.emplace(x, i);
  }
  vector<ii> sol;
  for (int i = 0; i < k; ++i) {
    auto [a, k] = p.top();
    auto [b, l] = q.top();
    if (a == b) break;
    p.pop();
    q.pop();
    sol.emplace_back(k + 1, l + 1);
    p.emplace(a - 1, k);
    q.emplace(a - 1, k);
    p.emplace(b + 1, l);
    q.emplace(b + 1, l);
  }
  cout << p.top().first - q.top().first << ' ' << sol.size() << '\n';
  for (ii p : sol) cout << p.first << ' ' << p.second << '\n';
}
