D - Yet Another Recursive Function
Editorial
/


Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 点
問題文
非負整数 に対し定義される関数 は以下の条件を満たします。
- 任意の正整数 に対し
ここで、 は の小数点以下を切り捨てた値を指します。
このとき、 を求めてください。
制約
- は を満たす整数
入力
入力は以下の形式で標準入力から与えられる。
出力
答えを出力せよ。
入力例 1Copy
Copy
2
出力例 1Copy
Copy
3
です。
入力例 2Copy
Copy
0
出力例 2Copy
Copy
1
入力例 3Copy
Copy
100
出力例 3Copy
Copy
55
Score : points
Problem Statement
A function defined for non-negative integers satisfies the following conditions.
- .
- for any positive integer .
Here, denotes the value of rounded down to an integer.
Find .
Constraints
- is an integer satisfying .
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1Copy
Copy
2
Sample Output 1Copy
Copy
3
We have .
Sample Input 2Copy
Copy
0
Sample Output 2Copy
Copy
1
Sample Input 3Copy
Copy
100
Sample Output 3Copy
Copy
55