L=int(input())#L位数N=int(input())#N进制row=[]list1=[]for i in range(1,N): row.append(1)list1.append(row)for i in range(1,L+1): row.clear() for n in range(N): if n==0: sum=sum(list1[i-1])-list1[i-1][n+1] row.append(sum) elif n==N-1: sum=sum(list1[i-1])-l…