You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
725 B
C++

#define _CRT_SECURE_NO_WARNINGS
#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING
#include <bits/stdc++.h>
using namespace std;
const int N = 205;
char mp[N][N];
int main()
{
int h, w, n;
scanf("%d%d%d", &h, &w, &n);
memset(mp, 0, sizeof(mp));
for (int i = 0; i < h; i++)
for (int j = 0; j < w; j++)
mp[i][j] = '*';
for (int i = 0; i < h; i++)
for (int j = i & 1; j < w; j += 2)
if (n)
{
mp[i][j] = '#';
n--;
}
else
mp[i][j] = '*';
if (n)
puts("-1");
else
for (int i = 0; i < h; i++)
puts(mp[i]);
return 0;
}