cho.sh
Notes
Loading...

Star Printing - 8

Time limit

1s

Memory limit

128 MB

Problem

Given an integer N, print a star pattern of width 2N in 2N-1 lines. In the upper half, the number of stars on both sides increases from 1 to N while the gap in the middle decreases by two spaces each line. Then print the same shape in reverse for the lower half.

Input

The first line contains an integer N.

  • 1 ≤ N ≤ 100

Output

Print 2N-1 lines. For each line, let k be the number of stars printed on one side. Print k stars, then 2(N-k) spaces, then k stars. The value of k increases from 1 to N and then decreases from N-1 to 1.