importjava.util.Scanner;publicclassSolution{publicstaticvoidmain(String[]args){// TODO Auto-generated method stubint[]dy={0,1,-1};// Scanners=newScanner(System.in);for(inttc=1;tc<=10;tc++){intN=s.nextInt();int[][]table=newint[N][N];for(inti=0;i<N;i++){for(intj=0;j<N;j++){table[i][j]=s.nextInt();}}intcount=0;for(inti=0;i<N;i++){for(intj=0;j<N;j++){if(i+1<100&&table[i][j]==1){if(table[i+1][j]==0){table[i][j]=0;table[i+1][j]=1;}elseif(table[i+1][j]==2){table[i][j]=3;// 이미 교착상태count++;}}}}System.out.println("#"+tc+" "+count);}}}