Олимпиадный тренинг

Задача 38836. Multiplication table


Two numbers n and m are given. Create a two-dimensional array A[n][m], fill it with the multiplication table A[i][j]=i*j and display it on the screen. In this case, nested loops should not be used, the entire filling of the array must be done in one loop.
Input
The program receives as input two numbers n and m – the number of rows and columns, respectively.

Imprint
The program should output  the resulting array. Separate numbers with one space.
 
Examples
# Input Output
1 3 3 0   0  0
0  1  2
0  2  4