分形AI (CI翻译)
Ever since Kalevitch, a famous Berland abstractionist, heard of fractals, he made them the main topic of his canvases. Every morning the artist takes a piece of graph paper and starts with making a model of his future canvas. He takes a square as big as $*n* × *n*$ squares and paints some of them black. Then he takes a clean square piece of paper and paints the fractal using the following algorithm:
自从 Berland 著名抽象派画家 Kalevitch 听说分形以来,他便将分形作为画布上的主题。每天早晨,这位艺术家都会拿出一张方格纸,开始制作未来画布的模型。他取一张大小为 $*n* × *n*$ 个方格的正方形纸张,并将其中一些方格涂黑。然后,他拿出一张干净的正方形纸张,并按照以下算法绘制分形:AI (CI翻译)
Step 1. The paper is divided into $*n*^{2}$ identical squares and some of them are painted black according to the model.
步骤 1。 将纸张划分为 $*n*^{2}$ 个大小相同的方格,并根据模型将其中一些方格涂黑。AI (CI翻译)
Step 2. Every square that remains white is divided into $*n*^{2}$ smaller squares and some of them are painted black according to the model.
步骤 2。 将每个仍为白色的方格划分为 $*n*^{2}$ 个更小的方格,并根据模型将其中一些方格涂黑。AI (CI翻译)
Every following step repeats step 2.
之后的每一步都重复步骤 2。AI (CI翻译)

AI (CI翻译)
Unfortunately, this tiresome work demands too much time from the painting genius. Kalevitch has been dreaming of making the process automatic to move to making 3D or even 4D fractals.
遗憾的是,这项繁琐的工作耗费了这位绘画天才太多时间。Kalevitch 一直梦想着将这一过程自动化,以便开始制作 3D 甚至 4D 分形。AI (CI翻译)
Input
输入格式
AI (CI翻译)The first line contains integers $*n*$ and $*k*$ ($2 ≤ *n* ≤ 3$, $1 ≤ *k* ≤ 5$), where $*k*$ is the amount of steps of the algorithm. Each of the following $*n*$ lines contains $*n*$ symbols that determine the model. Symbol «.» stands for a white square, whereas «*» stands for a black one. It is guaranteed that the model has at least one white square.
第一行包含整数 $*n*$ 和 $*k*$($2 ≤ *n* ≤ 3$,$1 ≤ *k* ≤ 5$),其中 $*k*$ 表示算法执行的步数。接下来的 $*n*$ 行中,每行包含 $*n*$ 个字符,用于描述模型。符号 «.» 表示白色方格,符号 «*» 表示黑色方格。保证模型中至少有一个白色方格。AI (CI翻译)
Output
输出格式
AI (CI翻译)Output a matrix $*n*^{*k*} × *n*^{*k*}$ which is what a picture should look like after $*k*$ steps of the algorithm.
输出一个大小为 $*n*^{*k*} × *n*^{*k*}$ 的矩阵,表示执行 $*k*$ 步算法后图像的样子。AI (CI翻译)
样例
2 3
.*
..
.*******
..******
.*.*****
....****
.***.***
..**..**
.*.*.*.*
........
3 2
.*.
***
.*.
.*.***.*.
*********
.*.***.*.
*********
*********
*********
.*.***.*.
*********
.*.***.*.
题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。