Now it's the time for a hospital in Bitland to choose who will be sent to join this great mission. There are medical workers in the hospital ready to deploy and you can send arbitrary numbers of persons to the team. Also, a medical team need a captain in charge of all the work, so once we confirm the people in the team, we need to set one of them as captain too. However, being a captain needs a lot experience, so there are only
people capable with the responsibility of a captain. Therefore, A team cannot be made up of people without someone that can be the captain.
Also, due to the large memory of Bitland, the number of workers in hospital can be as large as ! And that means your answer can be very large, so please output the result of the answer modulo
.
The input consists of multiple test cases. The first line of the input contains an integer
--- the number of the test cases.
For each test cases, there will be two integers
,
separated by space in one line, which means the number of workers in hospital and the numbers of people who can be the captain. Here
.
For each test case, output a single integerin a line, denoting the answer modulo
.