1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | import sys def combination(a, b): if a < b: return 0 elif a == b: return 1 else: total = 1 for i in range(1, b + 1): total = total * a / i a –= 1 return int(total) t = int(sys.stdin.readline().rstrip()) for _ in range(t): n, m = map(int, sys.stdin.readline().rstrip().split()) print(combination(m, n)) | cs |