Deranged Exams#6391

Deranged Exams

1 second
64 megabytes
Medium

The first question on the Data Structures and Algorithms final exam has a list of terms and a second list of definitions. Students are to match each term with the correct definition. Unfortunately, Joe, who wrote a Visual BASIC program in high school and assumed he knew about Computer Science, did not bother to come to class or read the textbook. He has to guess randomly what the matches are. Let S(n, k) be the number of ways Joe can answer the question and get at least the first matches wrong.

For this problem, you will write a program to compute S(n, k).

Input

The first line contains the number of data sets (1 \le p \le 1000) that follow.

Each data set consists of a single line of input containing three space separated decimal integers. The first integer is the data set number. The second integer is the number (1 \le n \le 17) of terms to be matched in the question, The third integer is the number (0 \le k \le n) of initial matches to be incorrect.

Output

For each data set there is a single line of output. It contains the data set number followed by a single space which is then followed by the value of S(n, k).

Examples

Example 1

Loading
Loading