#include <iostream> #include <vector> using namespace std; const int N = 110; char g[N][N]; bool st[N][N]; int dx[8] = {0,0,-1,-1,-1,1,1,1}; int dy[8] = {1,-1,0,-1,1,-1,0,1}; int n,m; void dfs(int x,int y){ st[x][y] = true; for(int i = 0;i < 8;i++){ int nx = x + dx[i]; int ny = y + dy...