def binomial(n, k):
    """
    Calculate the binomial coefficient nCr(n,k).
    Input: n, k -- non-negative integers
    Output: Integer
    Examples:
    >>> binomial(30,12)
    86493225
    """
    nt = 1
    for t in range(min(k, n - k)):
        nt *= n - t
        nt //= t + 1
    return nt
