LearnPy Hub
← Decorators problems
Medium

Memoize

Write your own memoization decorator using a dictionary. Use it on a recursive fib(n) and print fib(n) and the number of entries in the cache.

Input

One integer 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
Memoize · Python practice problem · LearnPy Hub