#K89412. Diamond Pattern

    ID: 37525 Type: Default 1000ms 256MiB

Diamond Pattern

Diamond Pattern

Given a positive integer (N), print a symmetric diamond pattern of numbers. The diamond is constructed by printing numbers without space between them in each row and centering the text, so each line has a width of (2N-1) characters. The first (N) rows construct the upper half of the diamond and the remaining (N-1) rows form the lower half. For example, when (N=3), the output should be as follows:

  1  
 123 
12345
 123 
  1  

Make sure that the printed pattern exactly matches the described format (including the spaces) and ends each line with a newline character.

inputFormat

The input is read from standard input and consists of a single integer (N) ((1 \leq N \leq 100)) indicating the number of rows in the upper half of the diamond.

outputFormat

Print the diamond pattern to standard output. Each line of the diamond must have exactly (2N-1) characters, with the numbers centered and padded with spaces as needed. A newline character must be printed at the end of each line.## sample

1
1

</p>