/* #pragma GCC optimize("Ofast,unroll-loops") #pragma GCC target("avx2,fma,bmi,bmi2,sse4.2,popcnt,lzcnt") */ #include #define taskname "" #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define i64 long long #define pb push_back #define ff first #define ss second #define isz(x) (int)x.size() using namespace std; const int mxN = 2e5 + 5; const int mod = 1e9 + 7; const i64 oo = 1e18; int n, k; void solve() { cin >> n >> k; vector> ans(n * k, vector(n * k)); for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j) { char ch; cin >> ch; for (int ii = 0; ii < k; ++ii) for (int jj = 0; jj < k; ++jj) { ans[i * k + ii][j * k + jj] = ch; } } for (auto vec : ans) { for (auto ch : vec) cout << ch; cout << "\n"; } } signed main() { #ifndef CDuongg if(fopen(taskname".inp", "r")) assert(freopen(taskname".inp", "r", stdin)), assert(freopen(taskname".out", "w", stdout)); #else freopen("bai3.inp", "r", stdin); freopen("bai3.out", "w", stdout); auto start = chrono::high_resolution_clock::now(); #endif ios_base::sync_with_stdio(false); cin.tie(nullptr); int t = 1; //cin >> t; while(t--) solve(); #ifdef CDuongg auto end = chrono::high_resolution_clock::now(); cout << "\n"; for(int i = 1; i <= 100; ++i) cout << '='; cout << "\nExecution time: " << chrono::duration_cast (end - start).count() << "[ms]" << endl; cout << "Check array size pls sir" << endl; #endif }