Имя: Пароль: Зарегистрироваться Восстановить пароль
28/01/2023 15:27:30

Рабочее место участника

Задачи

586. Draw Grid

Ограничения: время – 1s/2s, память – 32MiB Ввод: input.txt или стандартный ввод Вывод: output.txt или стандартный вывод
Послать решение Blockly Посылки Темы Где Обсудить (0)

It is very easy to draw grids with ASCII characters. For example look at the picture below. It shows a (2x3) grid, where each smallest square is of size 2.
+--+--+--+
|..|..|..|
|..|..|..|
+--+--+--+
|..|..|..|
|..|..|..|
+--+--+--+

In this problem your job is very simple: Given sizes of the grid and size of smallest square, you will just have to draw the grid.
Input
First line of the input contains three integers S, N and M (0\ <\ S,\ N,\ M\ ≤\ 10). Here S is the size of smallest squares, N and M are the sizes of the grid.
Output
You'd have to print an (NxM) sized grid where each smallest square is of size (SxS). Note that blank places are denoted with '.'.

Sample Input

2 2 3


Sample Output

+--+--+--+
|..|..|..|
|..|..|..|
+--+--+--+
|..|..|..|
|..|..|..|
+--+--+--+