Problem: Xynazog was playing a game. He needed to score k points and he could play at most N moves and at least 1 move. In each move, he could get [0,k] points. Note: the number of points gained is always an integer.

Xynazog's friend PowerShell challenged Xenny to find the number of ways in which he could score k points in exactly N moves as per the given rules.

Input Format:

First line contains a natural no. T, denoting the no. of testcases.
Each of the following T lines contains 2 space-separated integers N and k.

Output Format:

Output the answer to each testcase on a new line.

Constraints:

1 ≤ T ≤ 100000

1 ≤ N,k ≤ 19

SAMPLE INPUT
1
2 2

SAMPLE OUTPUT
3

Explanation

Given k=2

k = 2 + 0
k = 0 + 2
k = 1 + 1

Solution (in PYTHON):

Solution:
'''

from operator import mul    # or mul=lambda x,y:x*y
from fractions import Fraction

def nCk(n,k): 
  return int( reduce(mul, (Fraction(n-i, i+1) for i in range(k)), 1) )
'''
'''
def choose(n, k):
    """
    A fast way to calculate binomial coefficients by Andrew Dalke (contrib).
    """
    if 0 <= k <= n:
        ntok = 1
        ktok = 1
        for t in xrange(1, min(k, n - k) + 1):
            ntok *= n
            ktok *= t
            n -= 1
        return ntok // ktok
    else:
        return 0
        
'''
from math import factorial

def calculate_combinations(n, r):
    return factorial(n) // factorial(r) // factorial(n-r)


  
def main():
	for _ in xrange(int(raw_input())):
		N,k = [int(x) for x in raw_input().split()]
		print calculate_combinations(k+N-1,N-1)

main()