#include #include using namespace std; #define DIM 2005 int N, M, K, Mat[DIM][DIM]; int main() { // #ifndef ONLINE_JUDGE // freopen("input.txt","r",stdin); // #endif // ONLINE_JUDGE cin >> N >> M >> K; int lin = 1; int x; for(int i = 1; i <= N; ++i) { int col = 1; for(int j = 1; j <= M; ++j) { cin >> x; for(int a = lin; a < lin + K; ++a) { for(int b = col; b < col + K; ++b) { Mat[a][b] = x; } } col += K; } lin += K; } for(int i = 1; i <= N * K; ++i) { for(int j = 1; j <= M * K; ++j) { cout << Mat[i][j] << ' '; } cout << '\n'; } return 0; }