#P12252. Heptagon Marble Pattern

    ID: 14359 Type: Default 1000ms 256MiB

Heptagon Marble Pattern

Heptagon Marble Pattern

Little Blue is fascinated by heptagons and is trying to form his favorite heptagon patterns using small marbles. The first four heptagon patterns require 1, 7, 18, and 34 marbles respectively.

It can be observed that the sequence follows a quadratic pattern. In fact, the number of marbles required for the nth heptagon pattern is given by:

\( f(n) = \frac{5n^2 - 3n}{2} \)

Your task is to compute the number of marbles needed for the n-th heptagon pattern. For example, when n = 1, the answer is 1; when n = 2, the answer is 7; when n = 3, the answer is 18; and when n = 4, the answer is 34.

Given n = 20240601, determine the value of f(20240601).

inputFormat

The input consists of a single line containing one positive integer n, indicating the index of the heptagon pattern.

outputFormat

Output a single integer, which is the number of marbles required for the n-th heptagon pattern.

sample

1
1