HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Problems from everywhere > problem:


TopCoder-7. 50244 - Chessboard Pattern

Guest
• Discussion of problem (1)

Volume problems

• KBH-1012. 50617 - KBH
• KBH-1013. 50618 - Code Correction
• TopCoder-1. 50761 - Magic Words
• TopCoder-2. 50246 - Making Potions
• TopCoder-3. 50245 - Santa Gifts
• TopCoder-4. 50701 - Cell Removal
• TopCoder-5. 50760 - Hexatridecimal...
• TopCoder-6. 50759 - Text Statistics
• TopCoder-7. 50244 - Chessboar...
• TopCoder-8. 50641 - Strong Prime ...
• VologdaInterCity-A. 50614 - Numbe...
• VologdaInterCity-B. 50632 - Again ...
• VologdaInterCity-C. 50646 - The m...
• VologdaInterCity-D. 50605 - Behind...
• VologdaInterCity-E. 50624 - Simple ...
• VologdaInterUni-A. 50628 - Matrix
• VologdaInterUni-B. 50541 - Binary t...

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 Alpha

A chessboard pattern is a pattern that satisfies the following conditions:

• The pattern has a rectangular shape.
• The pattern contains only the characters '.' (a dot) and 'X' (an uppercase letter X).
• No two symbols that are horizontally or vertically adjacent are the same.
• The symbol in the lower left corner of the pattern is '.' (a dot).

You are given two numbers. N is a number of rows and M is a number of columns. Write a program that generates the chessboard pattern with these dimensions, and outputs it.

Input
The first line contains two numbers N and M (1 ≤ N ≤ 50, 1 ≤ M ≤ 50) separated by a whitespace.
Output
Output should contain N lines each containing M symbols that correspond to the generated pattern. Specifically, the first character of the last row of the output represents the lower left corner (see example 1).

Input 1 Input 2 Input 3
8 8
3 1
1 20
Output 1 Output 2 Output 3
X.X.X.X.
.X.X.X.X
X.X.X.X.
.X.X.X.X
X.X.X.X.
.X.X.X.X
X.X.X.X.
.X.X.X.X
.
X
.
.X.X.X.X.X.X.X.X.X.X

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

www.contester.ru