#CCBCHBA0000075. Bảng cộng vuông (Square Addition Table)
Bảng cộng vuông (Square Addition Table)
Square Addition Table
Source: Phước Hưng OJ
Problem Statement
Given n, print an n-by-n table. Entry in row i and column j (both 1-based) is i+j. Separate neighboring values with exactly one space, without trailing spaces.
Input
One line containing exactly one integer n.
Output
Print exactly the required output described above. Do not print prompts, extra characters, or blank lines. For numerical rows, separate adjacent values with a single space and no trailing space.
Subtasks
- Subtask 1 (20%): 1 <= n <= 3.
- Subtask 2 (30%): 1 <= n <= 8.
- Subtask 3 (50%): 1 <= n <= 20.
Examples
Example 1
Input:
2
Output:
2 3
3 4
Explanation:
Row 1 contains 1+1 and 1+2; row 2 contains 2+1 and 2+2.
Example 2
Input:
1
Output:
2
Explanation:
The only cell (1,1) contains 2.