#include #include #include #include #include #define REP(i,a,b) for(i=a;i -1 && A[R-1][C] == target_color) { draw(R-1,C); } if(R-2 < H && A[R+1][C] == target_color) { draw(R+1,C); } if(C-1 > -1 && A[R][C-1] == target_color) { draw(R,C-1); } if(C-2 < W && A[R][C+1] == target_color) { draw(R,C+1); } } int main(void) { int i,j,k,l; int Q; scanf("%d",&H); scanf("%d",&W); for(i=0;i