import operator


def binom(n, k):
    """
    Binomial coefficient (n over k)
    """
    n = operator.index(n)
    k = operator.index(k)
    if not 0 <= k <= n:
        return 0
    m = n + 1
    num = 1
    den = 1
    for j in range(1, min(k, n - k) + 1):
        num *= m - j
        den *= j
    return num // den