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

~/algor $ cat problems/for-kopaytirish-jadvali

Multiplication table

Medium 1000 ms 64 MB 47%
Share

Positive integers $N$ and $M$ are given. Print a multiplication table with $N$ rows and $M$ columns: column $j$ of row $i$ holds the value $i * j$.

The grid of the Pythagorean multiplication table

Input

One line with two positive integers: $N$ and $M$.

Output

$N$ lines, each with $M$ integers separated by spaces.

Note

$1 \le N, M \le 20$

Examples

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

Sign in to submit a solution

Signing up is free and takes a minute.