#pragma GCC optimize("O3") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("avx,avx2") #include #define INF 1000000001LL #define LNF 1000000000000000001LL #define MOD 1000000007LL #define MAX 502 #define long long long #define all(x) x.begin(),x.end() using namespace std; int n,m; bool check(vector &pan, int x, int y) { bool vis[n][m]; memset(vis,0,sizeof vis); int cnt = 0; for(int i = 0; i=n || j+y >= m) return false; if(vis[i+x][j+y] || pan[i+x][j+y] == '.') return false; vis[i+x][j+y] = true; } } if(cnt < 2 || (cnt&1)) return false; return true; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n >> m; vector pan(n); for(int i = 0; i> pan[i]; for(int i = 0; i