You are viewing a single comment's thread. Return to all comments →
python 2
def f(n): return reduce(lambda x, y : x * y, [1] + range(1, n+1)) for _ in range(int(raw_input())): a, b = map(int, raw_input().split()) print (f(a + b - 1) // (f(a) * f(b - 1))) % 1000000007
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and Permutations
You are viewing a single comment's thread. Return to all comments →
python 2