def coefbin(n,k):
    T = [[0] * (n+1) for p in range(n+1)]
    for i in range(n+1):
        if i == 0:
            T[0][0] = 1
        else:
            for p in range(i+1):
                if p == 0:
                    T[i][p] = 1
                else:
                    T[i][p] = T[i-1][p-1] + T[i-1][p]
    return T[n][k]