def dist(a, b):
    return sum((i-j)**2 for i, j in zip(a, b))
def memoized(*args):
        try:
            return stored_results[args]
        except KeyError:
            result = stored_results[args] = fn(*args)
            return result