-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbj_10994.py
More file actions
49 lines (40 loc) · 831 Bytes
/
Copy pathbj_10994.py
File metadata and controls
49 lines (40 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import sys
sys.stdin = open('bj_10994_in.txt', 'r')
input = sys.stdin.readline
'''
*************
* *
* ********* *
* * * *
* * ***** * *
* * * * * *
* * * * * * *
* * * * * *
* * ***** * *
* * * *
* ********* *
* *
*************
'''
n = int(input().strip())
# 행 수 = 열 수 = 1 + (n-1)*4
size = 1 + (n - 1) * 4
ans = [[' ' for _ in range(cols)] for _ in range(rows)]
# for row in ans:
# print(row)
def paint(r, c, size):
# base
if size < 0:
return
# 상하
for col in range(c, c + size):
ans[r][col] = '*'
ans[r + size - 1][col] = '*'
# 좌우
for row in range(r, r + size):
ans[row][c] = '*'
ans[row][c + size - 1] = '*'
paint(r + 2, c + 2, size - 4)
paint(0, 0, size)
for row in ans:
print(''.join(row))