Time limit
1s
Memory limit
128 MB
Given an integer N, print a diamond-shaped pattern of asterisks with height 2×N-1. The middle line contains 2×N-1 asterisks, and the lines above and below it are symmetric. Each line begins with the required number of spaces and has no trailing spaces after the asterisks.
The first line contains an integer N. (1 ≤ N ≤ 100)
Print 2×N-1 lines in total. For the i-th line of the top N lines (1 ≤ i ≤ N), print N-i spaces followed by 2×i-1 asterisks. Then print the lower N-1 lines by repeating the upper part in reverse order.