func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     vector<pair<int, int>> a(n);     for (int i = 0; i < n; ++i) {       cin >> a[i].first;       a[i].second = i;     }     sort(a.begin() + 1, a.end());     reverse(a.begin() + 1, a.end());     int nxt = 1;     vector<pair<int, int>> ans;     for (int i = 0; i < n; ++i) {       if (nxt == i) {         cout << -1 << endl;         return 0;       }       int nxt2 = nxt;       for (int j = nxt; j < nxt + a[i].first && j < n; ++j) {         ans.push_back(make_pair(a[i].second, a[nxt2].second));         ++nxt2;       }       nxt = nxt2;     }     cout << ans.size() << endl;     for (int i = 0; i < ans.size(); ++i) {       cout << ans[i].first + 1 <<     << ans[i].second + 1 << endl;     }   }   