Preparando MOJI

Crystal Ball Sequence

2000ms 262144K

Description:

Crystal ball sequence on hexagonal lattice is defined as follows: n-th element is the number of lattice points inside a hexagon with (n + 1) points on each side. The formula is Hn = 3·n·(n + 1) + 1. You are given n; calculate n-th element of the sequence.

Input:

The only line of input contains an integer n (0 ≤ n ≤ 9).

Output:

Output the n-th element of crystal ball sequence.

Sample Input:

1

Sample Output:

7

Sample Input:

3

Sample Output:

37

Informação

Codeforces

Provedor Codeforces

Código CF470A

Tags

*specialimplementation

Submetido 0

BOUA! 0

Taxa de BOUA's 0%

Datas 09/05/2023 08:53:41

Relacionados

Nada ainda