#include <stdio.h>
int main() {
int n;
int x[1000],y[1000];
scanf("%d",&n);
for (int i=0; i<n;i++) {
scanf("%d",&x[i]);
}
for (int i=0;i<n;i++){
int p=i-x[i];
for (int j=i;j>p;j--) {
y[j]=y[j-1];
}
y[p]=i+1;
}
for (int i=0;i<n;i++) {
printf("%d ",y[i]);
}
printf("\n");
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: