300845: CF162A. Pentagonal numbers
Memory Limit:256 MB
Time Limit:3 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
A. Pentagonal numberstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output
Pentagonal numbers are figurate numbers which can be calculated using the formula pn = (3n2 - n) / 2 (always integer). You are given n; calculate n-th pentagonal number.
InputThe only line of input contains an integer n (1 ≤ n ≤ 100).
OutputOutput the n-th pentagonal number.
ExamplesInput2Output
5Input
5Output
35