//author:luckYrat(twitter:@luckYrat_) //競技プログラミングから逃げるな //https://www.youtube.com/watch?v=z_B9iJ8r4ic //せんげん! #include #include #include #include #include #include #include #include #include #include #include #include #include #include //なまえくーかん! using namespace std; using ll = long long; using P = pair; //てーすう! const int mod = 1000000007; const int inf = (1<<30)-1; const ll linf = (1LL<<62LL)-1; const double EPS = (1e-10); //でふぁいん! #define anyfill(n,s) setw(n) << setfill(s) #define loop(s) for(int i = 0; s > i; i++) #define rep(i,q) for(int i = 0; (q) > i; i++) #define repp(i,n,q) for(int i = n; (q) > i; i++) #define dep(i,q) for(int i = (q); 0 < i; i--) //みじかく! #define pb push_back #define fir first #define scn second #define ednl endl //いぇすのー! #define YesNo(a) (a?"Yes":"No") #define YESNO(a) (a?"YES":"NO") #define yesno(a) (a?"yes":"no") //きんぼーnほーこー!! P ar4[4] = {{0,1},{0,-1},{1,0},{-1,0}}; P ar8[8] = {{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}}; /* 確認ポイント cout << fixed << setprecision(n) << 小数計算//n桁の小数表記になる 計算量は変わらないが楽できるシリーズ min(max)_element(iter,iter)で一番小さい(大きい)値のポインタが帰ってくる count(iter,iter,int)でintがiterからiterの間にいくつあったかを取得できる */ __attribute__((constructor)) void initial() { cin.tie(0); ios::sync_with_stdio(false); } int main(){ int h,w,x;cin>>h>>w>>x; char a[h][w]; for(int i = 0; h > i; i++){ for(int j = 0; w > j; j++){ int I = i+1,J = j+1; if((I%2) && (J%2)){ a[i][j] = '.'; }else if((!(I%2)) && (!(J%2))){ a[i][j] = '#'; }else{ a[i][j] = '.'; } } } //必要数 int wan = ((h-1)/2)*((w-1)/2); //最大値 int nun = h*(w/2+1)+w/2; if((x-(h+w-1)+1)%4 || x<(h+w-1)-1 || x>nun){ cout << -1 << endl; }else{ //3,7,11...は偶数列なので(頭が)バグるため、奇数列を元に考えるのが得策 if((!((h+1)%4)) && (!((w+1)%4)) ){ //偶数列しかない場合 for(int i = 3; w > i; i+=4){ for(int j = 2; h > j; j+=2){ a[j][i] = '#'; } } int mv = (x-(h+w-1)+1)/4; int i = 1; for(; w-2 > i; i+=4){ if(h/2 <= mv){ for(int j = 0; h-2 > j; j+=2){ a[j][i] = '#'; mv--; } }else if(mv){ int j = 0; for(;h > j && mv;j+=2){ a[j][i] = '#'; mv--; } j+=2; for(;w > j; j+=2){ a[j][i] = '#'; } }else{ for(int j = 2; h > j; j+=2){ a[j][i] = '#'; } } } if(mv){ //3*hの形にする for(int I = 1; h > I; I+=4){ a[I][w-3] = '#'; } for(int I = 3; h > I; I+=4){ if(mv){ a[I][w-1] = '#'; } } }else{ if(h/2 <= mv){ for(int j = 0; h-2 > j; j+=2){ a[j][i] = '#'; mv--; } }else if(mv){ int j = 0; for(;h > j && mv;j+=2){ a[j][i] = '#'; mv--; } j+=2; for(;w > j; j+=2){ a[j][i] = '#'; } }else{ for(int j = 2; h > j; j+=2){ a[j][i] = '#'; } } } }else if((h+1)%4){ int mv = (x-(h+w-1)+1)/4; for(int i = 1; h > i; i+=4){ if(w/2 <= mv){ //全部左側 for(int j = 0; w-2 > j; j+=2){ a[i][j] = '#'; mv--; } }else if(mv){ //mv個左側 int j = 0; for(;w > j && mv; j+=2){ a[i][j] = '#'; mv--; } j+=2; for(;w > j; j+=2){ a[i][j] = '#'; } }else{ //全部左側 for(int j = 2; w > j; j+=2){ a[i][j] = '#'; } } } for(int i = 3; h > i; i+=4){ for(int j = 2; w > j; j+=2){ a[i][j] = '#'; } } }else{ int mv = (x-(h+w-1)+1)/4; for(int i = 1; w > i; i+=4){ if(h/2 <= mv){ for(int j = 0; h-2 > j; j+=2){ a[j][i] = '#'; mv--; } }else if(mv){ int j = 0; for(;h > j && mv;j+=2){ a[j][i] = '#'; mv--; } j+=2; for(;w > j; j+=2){ a[j][i] = '#'; } }else{ for(int j = 2; h > j; j+=2){ a[j][i] = '#'; } } } for(int i = 3; w > i; i+=4){ for(int j = 2; h > j; j+=2){ a[j][i] = '#'; } } } for(int i = 0; h > i; i++){ for(int j = 0; w > j; j++){ cout << a[i][j]; } cout << endl; } } }