Click Here to go back to the homepage.

Okvir Solution:


#include <bits/stdc++.h>
using namespace std;

int main(){
    // #ifndef TESTING
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // #endif

    int puzzley, puzzlex, u, l, r, d;
    cin >> puzzley >> puzzlex >> u >> l >> r >> d;
    string result[puzzley + u + d];
    string oddRow;
    string evenRow;
    for(int i = 0; i < puzzlex + l + r; i++){
        if(i % 2 == 0){
            oddRow.push_back('#');
            evenRow.push_back('.');
        } else {
            oddRow.push_back('.');
            evenRow.push_back('#');
        }
    }
    for(int i = 0; i < puzzley + u + d; i++){
        result[i] = i % 2 == 0 ? oddRow : evenRow;
        
    }
    
    for(int i = u; i < puzzley + u; i++){
        for(int j = l; j < l + puzzlex; j++){
            char c;
            cin >> c;
            result[i][j] = c;
        }
    }
    for(string s: result){
        cout << s << endl;
    }


    return 0;   
}