func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MOD = 1e9 + 7;   const int inf = 0x3f3f3f3f;   const long long Inf = 0x3f3f3f3f3f3f3f3f;   const int maxn = 1e3 + 4;   const int maxm = 1e5 + 4;   vector<int> v;   int n, k, b[maxn];   int main() {     ios::sync_with_stdio(false);     int i, j, kase;     cin >> n >> k;     for (i = 1; i <= n; ++i) cin >> b[i];     v.push_back(n);     auto it = v.begin();     for (i = n - 1; i >= 1; --i) {       it = v.begin();       int num = 0;       while (num < b[i]) {         if (*it >= i + k) num++;         it++;       }       v.insert(it, i);     }     for (i = 0; i < v.size(); ++i) {       if (i) cout <<    ;       cout << v[i];     }     cout << endl;     return 0;   }   