ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Разделы > Unsorted > задача:


50244 - Chessboard Pattern

Гость
• Обсуждение задачи (1)

Задачи раздела

• 50612 - Забавная игра
• 50617 - КВН
• 50618 - Коррекция кода
• 50620 - Покер
• 50621 - Почтовые цифры
• 50630 - Радиовышки
• 50631 - Роботы
• 50251 - Symmetric matrix
• 50244 - Chessboard Pattern
• 50428 - Three Times
• 50879 - Passed or Failed
• 50387 - Passengers in the Train
• 50438 - Pattern with stars
• 50426 - Calculating Sales
• 50425 - Calculating Weekly Pay
• 50456 - nth Digit of a Number
• 50463 - Drawing a Triangle

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. Сложность Альфа

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