HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Kovrov IT > problem:


2007.K. 50276 - Nice Floor

Guest
• Discussion of problem (1)

Volume problems

• 2010.E. 50664 - Polygons
• 2010.F. 50265 - Liars and Knights
• 2010.G. 50256 - Sequence
• 2010.H. 50282 - Coins
• 2010.I. 50257 - Galls village
• 2010.J. 50258 - String manipulations
• 2007.C. 50640 - Cubes
• 2007.D. 50271 - Factorial
• 2007.K. 50276 - Nice Floor
• 2007.A. 50671 - Phalanx
• 2007.B. 50270 - Bitsorting
• 2007.E. 50663 - Lights
• 2007.G. 50272 - Strange Numbers
• 2007.H. 50273 - Two Captains
• 2007.I. 50274 - Boundary Troops
• 2007.J. 50275 - Wedding
• 2007.F. 50690 - Parliament

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