#pragma GCC optimize ("O3,inline,omit-frame-pointer,no-asynchronous-unwind-tables,fast-math") #include #include #include using namespace std; #define rep(i, a, n) for(ll i = a; i < n; i++) #define rrep(i, a, n) for(ll i = a; i >= n; i--) #define inr(l, x, r) (l <= x && x < r) #define ll long long #define ld long double #define pii pair #define pll pair #define all(x) (x).begin(), (x).end() //constexpr ll MOD = 1000000007; constexpr ll MOD = 998244353; constexpr int IINF = 1001001001; constexpr ll INF = 1LL<<60; template void chmax(t&a,u b){if(a void chmin(t&a,u b){if(b> h >> w >> k; if(k == 0){ rep(i,0,h){ rep(j,0,w) cout << '.'; cout << endl; } return 0; } if(h == 1){ if(k == 1){ string ans(w,'.'); ans[0] = '#'; cout << ans << endl; }else{ cout << -1 << endl; } return 0; } if(w == 1){ if(k == 1){ string ans(h,'.'); ans[0] = '#'; for(auto x: ans) cout << x << endl; }else{ cout << -1 << endl; } return 0; } if(k == 1){ cout << -1 << endl; return 0; } if(k <= w){ vector ans(h,string(w,'.')); rep(i,0,k-1) ans[0][i] = '#'; rep(i,0,h){ cout << ans[i] << endl; } return 0; } if(k > h*w-w-h+2){ cout << -1 << endl; return 0; } vector ans(h,string(w,'.')); rep(i,0,w) ans[0][i] = '#'; ll now = w; rep(j,2,w)rep(i,1,h-1){ if(j%2) continue; if(now > k-(j == w-1 ? 1 : 2)) continue; ans[i][j] = '#'; now += (j == w-1 ? 1 : 2); } rep(i,1,h-1){ if(now == k) continue; ans[i][0] = '#'; now++; } rep(i,0,h){ cout << ans[i] << endl; } // if(now != k){ // cout << 1/(ll)(ans[0][0]-'#') << endl; // } return 0; }