func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 1005;   int b[maxn];   int c[maxn];   bool visit[maxn];   int n, k;   int main() {     int i, p;     while (scanf( %d%d , &n, &k) != EOF) {       for (i = 1; i <= n; i++) scanf( %d , &b[i]);       memset(c, 0, sizeof(c));       memset(visit, false, sizeof(visit));       for (p = 1; p <= n; p++) {         for (i = 1; i <= n; i++)           if (c[i] == b[i] && visit[i] == false) break;         printf( %d  , i);         int u = i;         visit[u] = true;         for (i = 1; i <= n; i++)           if (u >= i + k)             c[i]++;           else             break;       }       printf(  n );     }     return 0;   }   