//#pragma GCC optimize ("O2") //#pragma GCC target ("avx2") #include //#include //using namespace atcoder; using namespace std; typedef long long ll; #define rep(i, n) for(int i = 0; i < (n); i++) #define rep1(i, n) for(int i = 1; i <= (n); i++) #define co(x) cout << (x) << "\n" #define cosp(x) cout << (x) << " " #define ce(x) cerr << (x) << "\n" #define cesp(x) cerr << (x) << " " #define pb push_back #define mp make_pair #define chmin(x, y) x = min(x, y) #define chmax(x, y) x = max(x, y) #define Would #define you #define please int main() { cin.tie(0); ios::sync_with_stdio(false); int W, H, X; cin >> W >> H >> X; int h = 0, w = 0; if ((H + 1) % 3 == 0) h = 2; else h = 1; if ((W + 1) % 3 == 0) w = 2; else w = 1; int wh = h * w * 9; if (X > wh) { co(-1); return 0; } if (H % 3 == 1) { rep(i, H / 3) { if (W % 3 == 1) { rep(j, W / 3) cout << X << 0 << 0; co(X); } else if (W % 3 == 0) { rep(j, W / 3) cout << 0 << X << 0; cout << endl; } else { rep(j, W / 3) cout << X / 2 << (X + 1) / 2 << 0; cout << X / 2 << (X + 1) / 2 << endl; } rep(j, W) cout << 0; cout << endl; rep(j, W) cout << 0; cout << endl; } if (W % 3 == 1) { rep(j, W / 3) cout << X << 0 << 0; co(X); } else if (W % 3 == 0) { rep(j, W / 3) cout << 0 << X << 0; cout << endl; } else { rep(j, W / 3) cout << X / 2 << (X + 1) / 2 << 0; cout << X / 2 << (X + 1) / 2 << endl; } return 0; } if (H % 3 == 0) { rep(i, H / 3) { rep(j, W) cout << 0; cout << endl; if (W % 3 == 1) { rep(j, W / 3) cout << X << 0 << 0; co(X); } else if (W % 3 == 0) { rep(j, W / 3) cout << 0 << X << 0; cout << endl; } else { rep(j, W / 3) cout << X / 2 << (X + 1) / 2 << 0; cout << X / 2 << (X + 1) / 2 << endl; } rep(j, W) cout << 0; cout << endl; } return 0; } if (W % 3 == 1) { rep(i, H / 3) { rep(j, W / 3) cout << X / 2 << 0 << 0; co(X / 2); rep(j, W / 3) cout << (X + 1) / 2 << 0 << 0; co((X + 1) / 2); rep(j, W) cout << 0; cout << endl; } rep(j, W / 3) cout << X / 2 << 0 << 0; co(X / 2); rep(j, W / 3) cout << (X + 1) / 2 << 0 << 0; co((X + 1) / 2); return 0; } if (W % 3 == 0) { rep(i, H / 3) { rep(j, W / 3) cout << 0 << X / 2 << 0; cout << endl; rep(j, W / 3) cout << 0 << (X + 1) / 2 << 0; cout << endl; rep(j, W) cout << 0; cout << endl; } rep(j, W / 3) cout << 0 << X / 2 << 0; cout << endl; rep(j, W / 3) cout << 0 << (X + 1) / 2 << 0; cout << endl; return 0; } int a = X / 4; int b = (X + 1) / 4; int c = (X + 2) / 4; int d = (X + 3) / 4; rep(i, H / 3) { rep(j, W / 3) { cout << a << b << 0; } cout << a << b << endl; rep(j, W / 3) { cout << c << d << 0; } cout << c << d << endl; rep(j, W) cout << 0; cout << endl; } rep(j, W / 3) { cout << a << b << 0; } cout << a << b << endl; rep(j, W / 3) { cout << c << d << 0; } cout << c << d << endl; Would you please return 0; }