#include char cave[25][25]; void printCave(int w, int h){ int i,j; for(j=0;j= (w-1)){continue;} if(ty >= (h-1)){continue;} if(cave[ty][tx] == 'A'){continue;} nDis = tmp[ty][tx]; if(tDis < nDis){ queue[start] = (tDis*10000) + (tx*100) + ty; start = (start+1)%MOD; } } } return 999999; } int main(void){ int i,j; int w,h; int minDis = 20000; char paint = 'A'; scanf("%d %d", &w, &h); for(j=0;j