https://www.acmicpc.net/problem/1010
서쪽에 있는 사이트만큼은 무조건 다리를 만들어야한다. 따라서, 동쪽의 개수 중에서 겹치지 않게 서쪽의 사이트 개수 만큼 뽑아주면된다. ->조합
import math
t=int(input())#테스트 케이스의 개수
for _ in range(t):
n,m=map(int, input().split())
print(int(math.factorial(m)/(math.factorial(m-n)*math.factorial(n))))