#include #include using namespace atcoder; using namespace std; using namespace std::chrono; using ll = long long; using ull = unsigned long long; using vi = vector; using vl = vector; using vb = vector; using vd = vector; using vs = vector; using vvi = vector>; using vvl = vector>; #define ALL(x) (x).begin(), (x).end() #define coutY cout << "Yes" << endl; #define coutN cout << "No" << endl; #define arrIn(arr, start, N) for (ll i = (start); i < (N); ++i) cin >> arr[i]; #define arrOut(arr, start, N) for (ll i = (start); i < (N); ++i) { cout << arr[i]; if(i==(N)-1) cout << endl; else cout << " "; } #define UNIQUE(A) sort(ALL(A)); A.erase(unique(ALL(A)),A.end()); #define mod9 998244353 #define mod1 1000000007 const int intM=1e9; const ll llM=1e18; void yn(bool tf) { cout << (tf ? "Yes" : "No") << endl; } void YN(bool tf) { cout << (tf ? "YES" : "NO") << endl; } string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string abc="abcdefghijklmnopqrstuvwxyz"; vi dx={0,-1,1,0}; vi dy={-1,0,0,1}; vi ddx={-1,0,1,-1,1,-1,0,1}; vi ddy={-1,-1,-1,0,0,1,1,1}; template using priority_queueR = priority_queue, greater>; //cout << fixed << setprecision(20) << void arrOut2(auto A){ for(auto x:A){ for(auto y:x){ cout << y << " "; } cout << endl; } } bool kaibun(string S){ string T=S; reverse(ALL(S)); return S==T; } int ketawa(int x){ string S=to_string(x); int sum=0; int len=S.size(); for(int i=0;in)return 0; ll bunshi=1; for(ll i=1;i<=n;i++)bunshi=(bunshi*i)%m; ll bunbo=1; for(ll i=1;i<=r;i++)bunbo=(bunbo*i)%m; for(ll i=1;i<=n-r;i++)bunbo=(bunbo*i)%m; return (bunshi*Power(bunbo,m-2,m))%m; } // auto start = high_resolution_clock::now(); // bool CheckTime(auto limit,auto eps){ // auto end = high_resolution_clock::now(); // return duration_cast(end - start).count()> N >> M; vs S(N); for(int i=0;i> S[i]; vi count(M,0); for(int i=0;ii)S[i][j]='#'; else S[i][j]='.'; } } //arrOut(count,0,M); //for(int i=0;ij)S[i][j]='#'; else S[i][j]='.'; } } for(int i=0;i