| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 95 | 78 | 52 | 80.000% |
Peter really likes to solve puzzles and his friends know this. They recently asked Peter to solve a well-known puzzle: given a triangular figure of height 3ドル$ (see the figure right), how many triangles pointing upwards are in the figure? Peter solved this problem in no-time so he asked his friends for some harder puzzles. And they came up with the same figure of height 4ドル$ and height 5ドル$ which Peter easily solved.
However, Peter got himself in a bit of trouble when his friends want him to solve the puzzle with a figure of height 6ドル$. Peter still wants to impress his friends with the correct answer, and he wants to be able to solve the puzzles with an even greater height, possibly up to two million! Since he's a very bad programmer, he asked you for help: given the height of the triangle $n,ドル can you determine how many triangles pointing upwards there are visible in the figure?
Figure 1 - A triangle puzzle with height 3. There are 10 upward triangles in this figure.
The input consists of one integer $n$ ($ 1 \leq n \leq 2 \cdot 10^6 $): the height of the triangle.
One integer with the number of triangles pointing upwards in the figure.
5
35
83948
98604181205900