map int input split for in range min append for in range max append fo

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
n, k = map(int, input().split())
a = []
for i in range(min(n,k)):
a.append([])
for j in range(max(n,k)):
a[i].append(1)
for i in range(min(n,k) - 1):
for j in range(max(n,k) - 1):
a[i + 1][j + 1] = a[i + 1][j] + a[i][j + 1]
print(a[n - 1][k - 1] % ((10 ** 6) + 7))