#!/usr/bin/env python
# -*- coding: utf-8 -*-


def memo(func):
    cache = {}

    def wrap(*args):
        if args not in cache:
            cache[args] = func(*args)
        return cache[args]

    return wrap


@memo
def fibonacci(n):
    if n <= 1:
        return 1

    return fibonacci(n - 1) + fibonacci(n - 2)


@memo
def climb_steps(n, steps=(1, 2)):
    count = 0
    if n == 0:
        count = 1
    elif n > 0:
        for step in steps:
            count += climb_steps(n - step, steps)
    return count


# fibonacci = memo(fibonacci)
print(fibonacci(50))
print(climb_steps(100))
