BOJ - 3076 - 상근이의 체스판

Updated:

def solution():
    R, C = map(int, input().split(' '))
    A, B = map(int, input().split(' '))

    ret = [['.' for _ in range(C * B)] for _ in range(R * A)]

    for i in range(R):
        for j in range(C):
            for k in range(A):
                for l in range(B):
                    if i % 2 == 0 and j % 2 == 0:
                        ret[i * A + k][j * B + l] = 'X'
                    if i % 2 == 1 and j % 2 == 1:
                        ret[i * A + k][j * B + l] = 'X'


    for i in ret:
        print("".join(i))

solution()

https://www.acmicpc.net/problem/3076

Categories:

Updated:

Leave a comment