#CCBCHBA0000101. Lưới số theo hàng (Row-Major Number Grid)
Lưới số theo hàng (Row-Major Number Grid)
Row-Major Number Grid
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given a grid of rows and columns, fill integers 1 through in row-major order (left to right, top to bottom). Print the grid, with one space between adjacent numbers and no trailing spaces.
Input
One line contains integers , number of rows and columns respectively.
Output
Print lines of exactly numbers each in row-major order.
Subtasks
-
Subtask 1 (20%): .
-
Subtask 2 (30%): .
-
Subtask 3 (50%): .
Examples
Example 1
Input:
2 3
Output:
1 2 3
4 5 6
Explanation:
Values increase from left to right and continue at the beginning of the following row. For this sample, the input is 2 3; the displayed rows follow these rules exactly.
Example 2
Input:
1 4
Output:
1 2 3 4
Explanation:
Values increase from left to right and continue at the beginning of the following row. For this sample, the input is 1 4; the displayed rows follow these rules exactly.