Some error occured while loading page for you. Please try again.
Given two integers and . In how many ways can items be chosen from items?
The first line contains the number of test cases . Each of the next lines contains two integers and .
Output lines, containing the required answer for the corresponding test case. Output all answers modulo .