LearnPy Hub
← Decorators problems
Medium

Caching Saves Calls

Write a decorator cache that remembers results by argument and counts how many times the real function body runs (store the count on wrapper.calls). Decorate a recursive Fibonacci, read n and print fib(n) and the number of real calls.

Input

One integer n (0 ≤ n ≤ 90).

Output

Two lines.

Sample 1

Input
10
Output
55
11

Sample 2

Input
0
Output
0
1
solution.py
Output appears here
Caching Saves Calls · Python practice problem · LearnPy Hub