f91
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
McCarthy is a famous theorician of computer science. In his work, he defined a recursive function, called f91, that takes as input a positive integer n and returns a positive integer defined as follows:
If n ≤ 100, then f91(n) = f91(f91(n + 11));
If n ≥ 101, then f91(n) = n - 10.
Input
A positive integer n not greater than 1000000.
Output
The value of f91(n).
Examples
Input #1
Answer #1
Submissions 5K
Acceptance rate 60%