Time limit
1s
Memory limit
256 MB
Print a star triangle of height N. Start with the base triangle of height 3. Whenever the height doubles, place one copy of the previous triangle centered in the upper half, then place two copies of the previous triangle in the lower half with one space between them. Spaces are part of the pattern, so they must be printed with the correct shape on every line.
The first line contains an integer N. N is always of the form 3 × 2^k, where k is an integer and 0 ≤ k ≤ 10.
Print the star pattern from the first line through the N-th line. Each line must keep the correct shape, including the spaces inside and around the stars.