def binomial(n, k):
    """
    Chose k objects from n.

    (n, k) = n!/(k!(n-k)!)

    Pascal's rule:
    (n + 1, k) = (n, k) + (n, k - 1)
    (k, k) = 0
    """
    # if k > n:
    #     return 0
    # if k == n or k == 0:
    #     return 1
    # return binomial(n - 1, k) + binomial(n - 1, k - 1)

    res = 1

    for i in range(1, k + 1):
        res = res * (n - i + 1) // i

    return res