Problem2306--Enlarged Checker Board

2306: Enlarged Checker Board

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

Time Limit: 2 sec / Memory Limit: 1024 MB

Score : 200200 points

Problem Statement

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\times N)(A×N) horizontal rows and (B\times N)(B×N) vertical columns.
For 1\leq i,j \leq N1i,jN, 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|=1ac+bd=1 (where |x|x denotes the absolute value of xx).
Print the grid XX in the format specified in the Output section.

Constraints

  • 1 \leq N,A,B \leq 101N,A,B10
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:
NNAABB

Output

Print (A\times N)(A×N) strings S_1,\ldots,S_{A\times N}S1,,SA×N that satisfy the following condition, with newlines in between.
  • Each of S_1,\ldots,S_{A\times N}S1,,SA×N is a string of length (B\times N)(B×N) consisting of . and #.
  • For each ii and jj (1 \leq i \leq A\times N,1 \leq j \leq B\times N)(1iA×N,1jB×N), the jj-th character of S_iSi is . if the square at the ii-th row from the top and jj-th column from the left in grid XX is painted white; the character is # if the square is painted black.

Sample Input Copy

4 3 2

Sample Output Copy

..##..##
..##..##
..##..##
##..##..
##..##..
##..##..
..##..##
..##..##
..##..##
##..##..
##..##..
##..##..

Source/Category