No.2174 3 O'clock Easy
タグ : / 解いたユーザー数 77
作問者 :
dolp
/ テスター :
Problem Statement
There are $N$ children at Competitive Programming Kindergarten. Teacher dolp has decided to line the children up in a row and give chocolates to them: $1$ chocolate to the first child, $4$ to the second, $27$ to the third..., and so on, giving $3k-2$ chocolates to the $3k-2$-th child, $(3k-1)^2$ chocolates to the $3k-1$-th child, and $(3k)^3$ chocolates to the $3k$-th child.
How many chocolates are needed in total?
Constraints
$1\:{\leq}\:N\:{\leq}\:10^{4} $
$k\:$ is an integer satisfying $\:1\:{\leq}\:k\:{\leq}\:\frac{N}{3}\:$
Input
$N$
Output
Print a newline at the end.
Sample
Sample 1
Input
6
Output
277
The answer is $1^1+2^2+3^3+4^1+5^2+6^3=1+4+27+4+25+216=277$.
Sample 2
Input
20
Output
13076
Sample 3
Input
2022
Output
1398031550101
That is a lot of chocolate.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。