def binomial_coefficient(n, k):
    """
    Binomial coefficient
    """
    if k > n or k < 0:
        return 0
    nk = 1
    kf = 1
    for i in range(0, k):
        nk *= n - i
        kf *= k - i
    return nk // kf
