l=[[]]

def nck(n,k):
    if(k==0 or n==k):
        l[n][k]=1
        return l[n][k]
    if(l[n][k]):
        return l[n][k]
    l[n][k]=nck((n-1),(k-1))+nck((n-1),k)
    return l[n][k]
    
n,k=map(int,input().split())
for i in range(n+1):
    l.append([0 for j in range(k+1)])
nck(n,k)
print(l[n][k])

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: