The binomial coefficient , , is an important concept in mathematics. Formally, represents the number of ways to choose a subset of elements from a set of elements. For example, there are three ways to choose a subset of elements from a set of three elements, namely , and . Hence .
To compute , it is convenient to use the following recursive formula: The base case given by for any .
The binomial coefficients can be arranged into Pascal’s triangle:
| 1 | ||||||||||||
| 1 | 1 | |||||||||||
| 1 | 2 | 1 | ||||||||||
| 1 | 3 | 3 | 1 | |||||||||
| 1 | 4 | 6 | 4 | 1 | ||||||||
| 1 | 5 | 10 | 10 | 5 | 1 | |||||||
| 1 | 6 | 15 | 20 | 15 | 6 | 1 |
Each row contains the binomial coefficients , and each element is the sum of the two elements immediately above it.
The input starts with an integer , the number of cases. On each of the following lines are two integers and satisfying .
For each case, output the binomial coefficient on a single line.
Input
4 0 0 3 2 4 4 6 2
Output
1 3 1 15