#CCBCHBA0000089. Bàn cờ chẵn lẻ (Parity Chessboard)
Bàn cờ chẵn lẻ (Parity Chessboard)
Parity Chessboard
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
For an -by- grid, number rows and columns starting from 1. Print X at if is even, and O otherwise. Print rows of consecutive characters. The upper-left cell is X.
Input
One line contains integers .
Output
Print lines, each containing characters X or O.
Subtasks
-
Subtask 1 (20%): .
-
Subtask 2 (30%): .
-
Subtask 3 (50%): .
Examples
Example 1
Input:
2 3
Output:
XOX
OXO
Explanation:
The upper-left coordinate sum is 2, an even number; parity alternates across rows and columns. For this sample, the input is 2 3; the displayed rows follow these rules exactly.
Example 2
Input:
1 1
Output:
X
Explanation:
The upper-left coordinate sum is 2, an even number; parity alternates across rows and columns. For this sample, the input is 1 1; the displayed rows follow these rules exactly.