#4297. Enlarged Checker Board

0
    ID: 4297 传统题 2000ms 1024MiB 尝试: 0 已通过: 0 难度: 1 上传者: 标签>AtCoderabc250BGESP 2级枚举(双层循环)模拟

Enlarged Checker Board

Enlarged Checker Board

题目描述

Tiles are aligned in NN horizontal rows and NN vertical columns. Each tile has a grid with AA horizontal rows and BB vertical columns. On the whole, the tiles form a grid XX with (A×N)(A\times N) horizontal rows and (B×N)(B\times N) vertical columns.
For 1≤i,j≤N1\leq i,j \leq N, Tile (i,j)(i,j) denotes the tile at the ii-th row from the top and the jj-th column from the left. Each square of XX is painted as follows.

Each tile is either a white tile or a black tile. Every square in a white tile is painted white; every square in a black tile is painted black. Tile (1,1)(1,1) is a white tile. Two tiles sharing a side have different colors. Here, Tile (a,b)(a,b) and Tile (c,d)(c,d) are said to be sharing a side if and only if ∣a−c∣+∣b−d∣=1|a-c|+|b-d|=1 (where ∣x∣|x| denotes the absolute value of xx).

Print the grid XX in the format specified in the Output section.

输入格式

Input is given from Standard Input in the following format: NN AA BB

输出格式

Print (A×N)(A\times N) strings S1,…,SA×NS_1,\ldots,S_{A\times N} that satisfy the following condition, with newlines in between.

Each of S1,…,SA×NS_1,\ldots,S_{A\times N} is a string of length (B×N)(B\times N) consisting of .. and #. For each iand and j (1 \leq i \leq A\times N,1 \leq j \leq B\times N),the, the j−thcharacterof-th character of S_iis is .ifthesquareatthe if the square at the i−throwfromthetopand-th row from the top and j−thcolumnfromtheleftingrid-th column from the left in grid X$ is painted white; the character is # if the square is painted black.

4 3 2
..##..##
..##..##
..##..##
##..##..
##..##..
##..##..
..##..##
..##..##
..##..##
##..##..
##..##..
##..##..
5 1 5
.....#####.....#####.....
#####.....#####.....#####
.....#####.....#####.....
#####.....#####.....#####
.....#####.....#####.....
4 4 1
.#.#
.#.#
.#.#
.#.#
#.#.
#.#.
#.#.
#.#.
.#.#
.#.#
.#.#
.#.#
#.#.
#.#.
#.#.
#.#.
1 4 4
....
....
....
....

提示

1≤N,A,B≤101 \leq N,A,B \leq 10 All values in input are integers.

标签: AtCoder|abc250B

来源

AtCoder|abc250B