eolymp
bolt
Try our new interface for solving problems
Problems

Matrix

Matrix

Two positive integers n and m are given. Print the matrix that consists of n lines and m columns, filled with positive integers from 1 to n * m, as shown in the sample.

Input

Two positive integers n and m (1n, m100).

Output

Print the required matrix.

Time limit 1 second
Memory limit 128 MiB
Input example #1
2 3
Output example #1
1 2 3
4 5 6
Author "ABC programming"
Source Matviychuk Sergiy Volodymyrovych