#964
Bronze III
PLANINA
시간 제한
1s
메모리 제한
32MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Mirko and Slavko are filming a movie adaptation of the popular SF novel "Chicks in space 13". The script requires them to present a lot of different worlds so they decided to film the entire movie in front of a green screen and add CGI backgrounds later. Mirko heard that the best way to generate artificial terrain is to use midpoint displacement algorithm. To start the algorithm, Mirko selects 4 points forming a perfect square. He then performs the following steps: 1. On each side of the square, he adds a new point in the exact middle of the side. The height of this new point is the average height of the two points on that side. 2. In the exact center of the square he adds a new point whose height is the average height of all 4 square vertices, plus a small random value. After those two steps are performed, he now has 4 new squares. He performs the same steps on the newly created squares again and again until he is pleased with the results. The following diagram illustrates 2 iterations of the algorithm. Start - 4 points 1 iteration - 9 points 2 iterations - 25 points Mirko noticed that some of the points belong to more than one square. In order to decrease memory consumption, he stores calculates and stores such points only once. He now wonders how many points in total will he need to store in memory after N iterations.

입력

The first and only line of input contains one integer N (1 ≤N ≤15), number of iterations. 4

출력

The first and only line of output should contain one number, the number of points stored after N iterations.

예제 입력 1

1

예제 출력 1

9

예제 입력 2

2

예제 출력 2

25

예제 입력 3

5

예제 출력 3

1089
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Bronze III1명 투표· 약 1개월 전
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.