Star Printing - 12

Time limit1sMemory limit128 MB

Summary
Print a diamond-like pattern of N to 1 to N stars with leading spaces forming 2N-1 lines.
Level

Easy1 of 10

Topics
Implementation
Solved
No attempts yet

Problem

Print a star pattern with 2 x N - 1 lines.

For the upper half, line i for 1 <= i <= N contains N - i spaces followed by i stars. After the line with N stars, print the same shape in reverse order using N - 1, N - 2, ..., 1 stars.

Input

The first line contains an integer N (1 <= N <= 100).

Output

Print the star pattern from the first line through the 2 x N - 1-th line.

Examples1

  1. Example 1

    Input
    3
    
    Expected output
      *
     **
    ***
     **
      *