#include<iostream> using namespace std; char s[55][55]; bool t[55][55]; int n, m; int ans = 0; int dx[8] = {1, 0, 1, 1, 0, -1, -1, -1}; int dy[8] = {0, 1, 1, -1, -1, 0, -1, 1}; int find(char a, char b) { int res = 0; for(int i = 1; i <= n; i ++) { for(int j = 1; j <= ...