Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/matritsa-karra-jadvali

Multiplication table

Easy 1000 ms 128 MB 20%
Share

Two positive integers $n$ and $m$ are given. Build and print the $n \times m$ multiplication table matrix: the element in row $i$ and column $j$ (counting from $1$) is

$$a_{i,j} = i * j$$

A multiplication table matrix built from the products of row and column numbers

Input

One line with two positive integers: $n$ and $m$.

Output

$n$ lines with $m$ space-separated integers each.

Note

$1 \le n, m \le 200$

Examples

Input #1
3 4
Output #1
1 2 3 4
2 4 6 8
3 6 9 12
Input #2
1 1
Output #2
1

Sign in to submit a solution

Signing up is free and takes a minute.