#CCBCHBA0000106. Lưới chẵn lẻ theo vị trí (Position-Parity Grid)
Lưới chẵn lẻ theo vị trí (Position-Parity Grid)
Position-Parity Grid
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given an -by- grid with 1-based indices, print 1 at when is even; otherwise print 0. Output rows of exactly adjacent characters with no spaces.
Input
One line contains and in this order.
Output
Print the grid as described.
Subtasks
-
Subtask 1 (20%): .
-
Subtask 2 (30%): .
-
Subtask 3 (50%): .
Examples
Example 1
Input:
2 3
Output:
101
010
Explanation:
There are 2 rows and 3 columns. Cell (1,1) is 1, and parity alternates along rows and columns.
Example 2
Input:
1 1
Output:
1
Explanation:
There are 1 rows and 1 columns. Cell (1,1) is 1, and parity alternates along rows and columns.