0 atcoder#ABC234A. [ABC234A] Weird Function
[ABC234A] Weird Function
Score : points
Problem Statement
Let us define a function as . Given an integer , find . Here, it is guaranteed that the answer is an integer not greater than .
Constraints
- is an integer between and (inclusive).
Input
Input is given from Standard Input in the following format:
Output
Print the answer as an integer.
0
1371
The answer is computed as follows.
- $f(t) = t^2 + 2t + 3 = 0 \times 0 + 2 \times 0 + 3 = 3$
- $f(f(t)+t) = f(3) = 3 \times 3 + 2 \times 3 + 3 = 18$
- $f(f(f(t)+t)+f(f(t))) = f(18+18) = f(36) = 36 \times 36 + 2 \times 36 + 3 = 1371$
3
722502
10
1111355571