Logo
(追記) (追記ここまで)

19836번 - Puzzle 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB49332362.162%

문제

Andrew is going to open his own factory for manufacturing puzzle pieces. He needs to order a special device that would cut pieces out of cardboard sheets. Also he needs to order a set of tips for it. Each tip allows to cut pieces of a particular form.

A puzzle piece is a square, each of its four sides can contain a rounded tab, a blank cut, or be smooth. The pieces can be of three different types:

  • <<Corners>> --- such pieces have exactly two adjacent smooth sides forming a corner;
  • <<Borders>> --- such pieces have exactly one smooth side;
  • <<Normal>> --- such pieces have no smooth sides.

Rounded tabs and blank cuts can each be of $k$ types. So, there are 2ドルk+1$ options for a puzzle piece side --- rounded tab of one of $k$ types, blank cut of one of $k$ types, a smooth side.

Andrew needs to find out how many different tips he need to order. Pieces, such that one of them can be rotated to become equal to another one, can obviously be cut out using the same tip.

Help Andrew to find the number of different tips he needs to order so that he would be able to cut any possible puzzle piece.

입력

The only line of input contains an integer $k$ --- the number of different rounded tabs and blank cuts types (1ドル \le k \le 10^4$).

출력

Output the number of different tips Andrew need to order.

제한

예제 입력 1

1

예제 출력 1

18

힌트

All 18ドル$ tips for $k = 1$ are presented at the picture below:

출처

Olympiad > Russian Olympiad in Informatics > Russia Team High School Programming Contest > Russia Team High School Programming Contest 2017 G번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /