# Baekjoon-15685-드래곤 커브

10 Oct 2022회전 변환!!!

```
N = int(input())
board = [[0] * 101 for _ in range(101)]
def add_generation(arr):
cx,cy = arr[-1]
new_arr = []
for x,y in reversed(arr[:-1]):
new_arr.append([cx+cy-y,x-cx+cy])
board[cx+cy-y][x-cx+cy] = 1
return arr + new_arr
for _ in range(N):
x,y,d,g = map(int, input().split())
dx,dy = [[1,0],[0,-1],[-1,0],[0,1]][d]
arr = [[x,y],[x+dx,y+dy]]
board[x][y] = board[x+dx][y+dy] = 1
for _ in range(g):
arr = add_generation(arr)
# count square
count = 0
for i in range(100):
for j in range(100):
if board[i][j] == 1 and board[i][j+1]==1 and board[i+1][j]==1 and board[i+1][j+1]==1:
count += 1
print(count)
```