Enlarged Checker Board

AtCoder
IDabc250_b
Time2000ms
Memory256MB
Difficulty
Tiles are aligned in $N$ horizontal rows and $N$ vertical columns. Each tile has a grid with $A$ horizontal rows and $B$ vertical columns. On the whole, the tiles form a grid $X$ with $(A\times N)$ horizontal rows and $(B\times N)$ vertical columns. For $1\leq i,j \leq N$, Tile $(i,j)$ denotes the tile at the $i$\-th row from the top and the $j$\-th column from the left. Each square of $X$ 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)$ is a white tile. * Two tiles sharing a side have different colors. Here, Tile $(a,b)$ and Tile $(c,d)$ are said to be sharing a side if and only if $|a-c|+|b-d|=1$ (where $|x|$ denotes the absolute value of $x$). Print the grid $X$ in the format specified in the Output section. ## Constraints * $1 \leq N,A,B \leq 10$ * All values in input are integers. ## Input Input is given from Standard Input in the following format: $N$ $A$ $B$ [samples]
Samples
Input #1
4 3 2
Output #1
..##..##
..##..##
..##..##
##..##..
##..##..
##..##..
..##..##
..##..##
..##..##
##..##..
##..##..
##..##..
Input #2
5 1 5
Output #2
.....#####.....#####.....
#####.....#####.....#####
.....#####.....#####.....
#####.....#####.....#####
.....#####.....#####.....
Input #3
4 4 1
Output #3
.#.#
.#.#
.#.#
.#.#
#.#.
#.#.
#.#.
#.#.
.#.#
.#.#
.#.#
.#.#
#.#.
#.#.
#.#.
#.#.
Input #4
1 4 4
Output #4
....
....
....
....
API Response (JSON)
{
  "problem": {
    "name": "Enlarged Checker Board",
    "description": {
      "content": "Tiles are aligned in $N$ horizontal rows and $N$ vertical columns. Each tile has a grid with $A$ horizontal rows and $B$ vertical columns. On the whole, the tiles form a grid $X$ with $(A\\times N)$ ho",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc250_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Tiles are aligned in $N$ horizontal rows and $N$ vertical columns. Each tile has a grid with $A$ horizontal rows and $B$ vertical columns. On the whole, the tiles form a grid $X$ with $(A\\times N)$ ho...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments