Advertisement
Guest User

Untitled

a guest
Jun 29th, 2020
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. def Factorial(var):
  2. fac = 1
  3.  
  4. for i in range(2, var + 1, 1):
  5. fac *= i
  6.  
  7. return fac
  8.  
  9.  
  10. def Binomial_theorem(n, k):
  11. comb = Factorial(n) / ((Factorial(k)) * (Factorial(n - k)))
  12. return comb
  13.  
  14. tests = int(input())
  15.  
  16. while tests:
  17. fans, places = [int(fans) for fans in input().split()]
  18.  
  19. ip = Binomial_theorem(fans, places)
  20. print(int(ip))
  21.  
  22. tests -= 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement