302438: CF470A. Crystal Ball Sequence
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
A. Crystal Ball Sequencetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output
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.
InputThe only line of input contains an integer n (0 ≤ n ≤ 9).
OutputOutput the n-th element of crystal ball sequence.
ExamplesInput1Output
7Input
3Output
37