#include<bits/stdc++.h> using namespace std; char a[1100][1100]; int vis[1100][1100]; int n, m; int dirt[8][2] = {{-1, -1}, {-1, 0}, {-1, 1}, {0, 1}, {1, 1}, {1, 0}, {1, -1},{0,-1},}; int main() { cin >> n >> m; int dx, dy; for(int i = 1; i <= n; i ++) { for(int j = 1; j &l...