#C9110. Game Board Generator

    ID: 53168 Type: Default 1000ms 256MiB

Game Board Generator

Game Board Generator

You are given an integer n (3 ≤ n ≤ 50) and a single character to be used as the border of a square board. Optionally, you may also be given a second character to fill the inner part of the board. Your task is to generate an n × n grid. The border of the grid must be filled with the given border character, while the inner cells should be filled with the inner character if provided; otherwise, they should be filled with a space.

Note: The input is read from stdin and the output must be printed to stdout as n lines of characters, each of exactly length n.

inputFormat

The input consists of either two or three lines:

  1. The first line contains an integer n (3 ≤ n ≤ 50), representing the size of the board.
  2. The second line contains a single character, representing the border of the board.
  3. The third line is optional. If present and non-empty, it contains a single character used to fill the inner portion of the board. If absent, use a space (' ') for the inner fill.

outputFormat

Output the generated board as n lines. Each line should be exactly n characters long, matching the description above.

## sample
5
#
#####

#####

</p>