LearnPy Hub
← Decorators problems
Hard

Measure Steps

Instead of time, count work: write a decorator that counts how many times a recursive function is called in one top-level call (reset the counter for each top-level call). Print fib(n) and the calls for plain recursive fib.

Input

One integer 0 ≤ n ≤ 20.

Output

Two numbers.

Sample 1

Input
5
Output
5 15

Sample 2

Input
0
Output
0 1
solution.py
Output appears here
Measure Steps · Python practice problem · LearnPy Hub