#C7250. Arithmetic Grid
Arithmetic Grid
Arithmetic Grid
Given a positive integer n, construct an n × n grid filled with consecutive integers starting from 1, arranged in row-major order. Each row of the grid forms an arithmetic sequence with a common difference of 1, and the same applies for each column. For example, if n = 3, the grid should be:
[ \begin{matrix} 1 & 2 & 3 \ 4 & 5 & 6 \ 7 & 8 & 9 \end{matrix} ]
Your task is to read the integer n from standard input, generate the grid accordingly, and output the grid such that each row is printed on a new line with numbers separated by a single space.
inputFormat
The input contains a single integer n (1 ≤ n ≤ 1000) on a line by itself, representing the size of the grid.
outputFormat
Output the generated n × n grid. Each row should be printed on a new line, and the numbers in each row must be separated by a single space.
## sample1
1