https://www.acmicpc.net/problem/2448
시간 제한 : 1초
메모리 제한 : 256MB
n = int(input())
graph = [[' '] * 2 * n for _ in range(n)]
def recursive(x, y, N):
# n = 3일 때
if N == 3:
graph[x][y] = '*'
graph[x + 1][y - 1] = graph[x + 1][y + 1] = '*'
for i in range(-2, 3):
graph[x + 2][y + i] = '*'
# 맨 처음 그래프를 양옆으로 복사
else:
nextN = N // 2
recursive(x, y, nextN)
recursive(x + nextN, y - nextN, nextN)
recursive(x + nextN, y + nextN, nextN)
recursive(0, n - 1, n)
for i in graph:
print("".join(i))