#include using namespace std; random_device rnd; mt19937 mt(rnd()); int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int N,U; cin >> N >> U; int H,W; cin >> H >> W; vector F(N); vector> S(N,vector(H)); for(int i=0; i> f; F.at(i) = f; for(int k=0; k> S.at(i).at(k); } int answer = -1001001001,now = 0; vector G = S.at(0); vector best; if(H*W <= 18){ auto dfs = [&](auto dfs,int x,int y) -> void { if(y == W) y = 0,x++; if(x == H){ now = 0; for(int i=0; i zero(H,string(W,'.')); while(true){ for(auto &h : zero) for(auto &w : h) w = mt()%2?'#':'.'; bool ok = true; for(int i=0; i NG(N); for(int i=1; i void {if(answer < now) answer = now,best = G;}; auto change = [&](int x,int y,char c) -> void { for(int i=0; i