Function to return the value of n ! / ( ( n - k ) ! * k ! )
def nck ( N , K ) : NEW_LINE INDENT factN = factorial ( N ) NEW_LINE inv = Inversefactorial ( K ) NEW_LINE invFact = Inversefactorial ( N - K ) NEW_LINE return ( ( ( factN * inv ) % Mod ) * invFact ) % Mod NEW_LINE DEDENT