#include #include #include using namespace std; bool seen[51][51][51][51]; struct st{ int step; int x,y; int xx[3],yy[3]; }; int main(){ ifstream cin("G.txt"); int w,h; while(cin>>w>>h && w+h){ memset(seen,0,sizeof(seen)); char buf[16][20]; char orig[16][20]; for(int i=0;i>buf[i]; memcpy(orig[i],buf[i],sizeof(orig[i])); } int x,y; int pos[16][16]={{0}}; int npos=1; int xx[3],yy[3]; int nn=0; for(int i=0;i q; q.push(first); while(q.size()){ st now=q.front(); q.pop(); bool allend=true; #if 0 cout<