#include #include #include char*O=NULL;typedef size_t S;typedef unsigned char U ;S n=0;void V(){S x,y;U*B=malloc(n* n *3);printf("P6\n%lu %lu\n255\n",n,n); #pragma /* passing any cmd line argument */\ omp parallel /* will enable netpbm stream output */ for for(y=0;y Q){S p=*(q-1);f+=I(p,&q);q--;}F+=f;if(h>1)V(O, n);else{if(y&&y%100==0)puts("");printf("\033[KStep %lu: " "%lu Flashes\n\033[F",y+1,F);}}puts("");free(O);free(Q);} inline int I( S j,S**q){if(O[j]>9){int x,y,X=(j%n!=n-1), Y=(j/ n!=n-1); O[j]=0;for(y=- (j/n!=0);y<=Y;y++){ for(x=-(j% n!=0);x<=X ;x ++){S e=y*n+x+j;if (O [e]){O[e ]++;*(*q )++=e;}}}*(*q )++=j; return 1;}return 0 ;}