#B4259. Matrix with Arithmetic Sequences

    ID: 11916 Type: Default 1000ms 256MiB

Matrix with Arithmetic Sequences

Matrix with Arithmetic Sequences

Given two positive integers $n$ and $m$, construct a matrix with $n$ rows and $m$ columns such that every row and every column forms an arithmetic sequence. It can be observed that if the element at the $i$-th row and $j$-th column is set to $i \times j$, the matrix satisfies the given condition.

Your task is to output this matrix.

inputFormat

The first line contains two integers nn and mm (1n,m10001 \le n, m \le 1000).

outputFormat

Output nn lines, each containing mm space-separated integers representing the matrix. The element in the ii-th row and jj-th column should be i×ji \times j.

sample

1 1
1

</p>