eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків
Задачі

Gokigen Naname

Gokigen Naname

\textit{Gokigen Naname} - японская игра-головоломка, в которую играют на квадратной сетке. Числа в кругах расположены на некоторых пересечениях сетки. Цель игры состоит в том, чтобы нарисовать диагональные линии в каждой ячейке сетки таким образом, чтобы число в каждом кругу равнялось количеству линий, исходящих из этого круга. Кроме того, диагональным линиям запрещено образовывать закрытый цикл. \includegraphics{https://static.e-olymp.com/content/c7/c7690744803b950916771a85e123fde7ede7e74f.jpg} Первый рисунок показывает начальное состояние головоломки. Второй рисунок показывает ее решение. Головоломка Gokigen Naname всегда имеет единственное решение. \InputFile The first line of the input contains a single integer \textbf{n} (\textbf{2} ≤ \textbf{n} ≤ \textbf{7}), the number of cells along each of the sides in the square grid. Then follow \textbf{n} + \textbf{1} lines containing the contents of the intersections of the grid cells. Each such line will contain a string of \textbf{n}\textit{ }+ \textbf{1} characters, either a digit between \textbf{0} and \textbf{4}, inclusive, or a period ('.') indicating that there is no number at this intersection (arbitrarily many lines may connect to it). \OutputFile The output should contain \textbf{n} lines, each line containing exactly \textbf{n} characters. Each character should either be a slash or a backslash, denoting how the corresponding grid cell is filled.
Ліміт часу 1 секунда
Ліміт використання пам'яті 64 MiB
Вхідні дані #1
2
...
.21
.10
Вихідні дані #1
//
//
Джерело 2009 Nordic Collegiate Programming Contest, Жовтень 3, Задача F