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

Задача 37042. Diagonal padding


Numbers n and m are given. Create an array A[n][m] and fill it as shown in the example.

Input: The program receives two numbers n and m as input.
Output: The program should output the resulting array, putting exactly 3 characters for each number.

Examples
# Input Output
1 4 10
  0 1 3 6 10 14 18 22 26 30
  2 4 7 11 15 19 23 27 31 34
  5 8 12 16 20 24 28 32 35 37
  9 13 17 21 25 29 33 36 38 39