#5114. Sierpinski carpet
Sierpinski carpet
Sierpinski carpet
题目描述
For a non-negative integer , we define a level- carpet as follows:
A level- carpet is a grid consisting of a single black cell. For K > 0, a level- carpet is a grid. When this grid is divided into nine blocks: The central block consists entirely of white cells. The other eight blocks are level- carpets.
You are given a non-negative integer .
Print a level- carpet according to the specified format.
输入格式
The input is given from Standard Input in the following format:
输出格式
Print lines.
The -th line () should contain a string of length consisting of and #.
The -th character of () should be # if the cell at the -th row from the top and -th column from the left of a level- carpet is black, and if it is white.
1
###
#.#
###
2
#########
#.##.##.#
#########
###...###
#.#...#.#
###...###
#########
#.##.##.#
#########
提示
is an integer.A level- carpet is a grid as follows:
When output according to the specified format, it looks like the sample output.
A level- carpet is a grid.
标签: AtCoder|abc357C
来源
AtCoder|abc357C