#K67417. Number Pattern
Number Pattern
Number Pattern
Given an integer n, generate a square pattern of numbers forming a matrix of size \( (2n-1) \times (2n-1) \).
The element at position \( (i,j) \) (0-indexed) is defined as:
\( \text{Element}_{i,j} = n - \min\{\min(i, 2n-2-i),\; \min(j, 2n-2-j)\} \)
This produces a pattern that is symmetric both vertically and horizontally. Each row of the pattern should be printed on a new line, and the numbers in each row should be separated by a single space.
Example:
Input: 2 Output: 2 2 2 2 1 2 2 2 2
inputFormat
An integer n (1 ≤ n ≤ 50).
outputFormat
Print the generated number pattern. Each row must be printed on a new line and the numbers in a row should be separated by a single space.## sample
1
1