PRACTICE SECTION-MEDIUM
MOST SUBMISSION-NUMBER 4
def combination(value):
if value == 1 or value == 0:
return 1
else:
return value * combination(value-1)
for _ in range(int(input())):
n, k = map(int, input().split())
r = n-k
p = combination(k+r-1)
q = combination®
s = combination(k-1)
print(p//(q*s))