def multinomial_coefficients(K: list) -> int:
    """
    Returns the multinomial coefficients

    - `K` - A list of [$k_1, k_2...$]
    """
    # Memoization method
    # A direct implementation of the binomial representation
    # Better for smaller numbers
#     m = 1
#     for i in range(1, len(K)+1):
#         m  *= binomial_coefficients(sum(K[:i]), K[i-1])

    # Iterative method
    res, i = 1, sum(K)
    i0 = K.index(max(K))
    for a in K[:i0] + K[i0+1:]:
        for j in range(1,a+1):
            res = (res * i) // j
            i -= 1
    return res