func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MAX = 1e6 + 6;   long long int arr[2000005], brr[2000005], crr[2000005];   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     long long int n, k, ans;     cin >> n >> k;     vector<pair<int, int> > v;     for (int i = 1; i <= n; i++) cin >> arr[i];     while (k--) {       int mx = 0;       for (int i = 1; i <= n; i++)         if (!mx || arr[i] > arr[mx]) mx = i;       int mn = 0;       for (int i = 1; i <= n; i++)         if (!mn || arr[i] < arr[mn]) mn = i;       if (mx == mn) {         ans = 0;         break;       }       arr[mx]--;       arr[mn]++;       v.push_back({mx, mn});     }     int mx = 0;     for (int i = 1; i <= n; i++)       if (!mx || arr[i] > arr[mx]) mx = i;     int mn = 0;     for (int i = 1; i <= n; i++)       if (!mn || arr[i] < arr[mn]) mn = i;     ans = arr[mx] - arr[mn];     cout << ans <<     << v.size() << endl;     for (int i = 0; i < v.size(); i++)       cout << v[i].first <<     << v[i].second << endl;   }   