fork download
  1. import math
  2.  
  3. def nCr(n,r):
  4. f = math.factorial
  5. return f(n) / f(r) / f(n-r)
  6.  
  7. a = list(map(int,input().split('\n')))
  8. print(a)
  9. for i in range(1,a[0]+1):
  10. print(int(nCr((a[2*i-1]+a[2*i]),(a[2*i]-1))))
Runtime error #stdin #stdout #stderr 0.02s 27656KB
stdin
2
1
3
2
3
stdout
[2]
stderr
Traceback (most recent call last):
  File "./prog.py", line 10, in <module>
IndexError: list index out of range