#include #define MAX_H 3000 #define MAX_W 3000 using namespace std; int H,W; int A[MAX_H][MAX_W]; void dfs(int x, int y){ A[y][x] = 0; int nx, ny; nx=x; ny=y+1; if(ny> H >> W; for(int j=0; j> A[j][i]; solve(); }