HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Kovrov IT > problem:


2007.K. 50276 - Nice Floor

Guest
• Discussion of problem (1)

Volume problems

• 2007.C. 50640 - Cubes
• 2007.D. 50271 - Factorial
• 2007.E. 50663 - Lights
• 2007.F. 50690 - Parliament
• 2007.G. 50272 - Strange Numbers
• 2007.H. 50273 - Two Captains
• 2007.I. 50274 - Boundary Troops
• 2007.J. 50275 - Wedding
• 2007.K. 50276 - Nice Floor
• 2008.A. 50672 - Math and Soldiers
• 2008.B. 50261 - Roads
• 2008.C. 50262 - Brackets
• 2008.D. 50279 - Bit Decoder
• 2008.E. 50263 - Points
• 2008.F. 50972 - Division
• 2008.G. 50264 - String Multiplication
• 2008.H. 50254 - Lawyers Council

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Автор: Павел Кузнецов, ПГУ. Difficulty Beta

Once a king of Byteland conceived repair in his palace. It was necessary to break a pair of walls and make a banquet hall more spacious. When he planned a floor, he thought what would be more beautifil - marble or wooden parquet. Marble is more smooth, but it would be more painful to fall on it, so the king chose parquet. And he wanted something unusual. Palace hall is a square with side N meters. Every parquet piece is a square with side 1 meter and of white or black color. There are enough pieces of each color to cover the floor with them. But the king askes you to lay the floor with the pieces, considering the following conditions:

• The four corner pieces must have the same color.
• Every piece must have at least 2 neighbour pieces of other color.

Two pieces are neighbours if they contact by a side.
Your task is to present the plan of covering the floor or to say if it is impossible.

Input
The first line contains an integer number N (3 ≤ N ≤ 200).
Output
If it is impossible to lay the hall in the way the king asked, write "NO SOLUTION" without quotes. Otherwise, output must contain N lines, N symbols length each. White pieces must be presented as '.' (dot), black '#' (sharp).

Input 1 Output 1
3
.#.
#.#
.#.

Для отправки решений необходимо выполнить вход.

www.contester.ru