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