Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def Factorial(var):
- fac = 1
- for i in range(2, var + 1, 1):
- fac *= i
- return fac
- def Binomial_theorem(n, k):
- comb = Factorial(n) / ((Factorial(k)) * (Factorial(n - k)))
- return comb
- tests = int(input())
- while tests:
- fans, places = [int(fans) for fans in input().split()]
- ip = Binomial_theorem(fans, places)
- print(int(ip))
- tests -= 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement