#K71372. Number Pyramid Generator

    ID: 33517 Type: Default 1000ms 256MiB

Number Pyramid Generator

Number Pyramid Generator

Given an integer n, generate a number pyramid of height n. Each row i (1 ≤ i ≤ n) contains the numbers from 1 to i separated by a space, and the row is centered in a width of 2n-1 characters. The numbers in each row must be aligned such that the pyramid is symmetric.

The centering uses the formula: \( \text{width} = 2n - 1 \). For each row, after joining the numbers with a single space, add spaces on the left and right such that the resulting string is of length \(2n-1\) with the numeric pattern centered.

For example, if n = 4, the pyramid will be:

   1   
  1 2  
 1 2 3 
1 2 3 4

inputFormat

The input consists of a single integer n (1 ≤ n ≤ 100), representing the height of the pyramid.

Input is read from standard input (stdin).

outputFormat

Output the pyramid pattern with n lines. Each line should consist of the numbers from 1 up to the line number, separated by a space, and centered in a field of width \(2n-1\) characters. The output is printed to standard output (stdout).

## sample
1
1