The Uncountable Ways
Easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
There is a rectangle of units. Another rectangle of units is cut off from the upper right corner. Count the number of ways an ant can reach the bottom right corner starting from the top left corner, if it can move along the grid lines only right or down.
Input
The first line contains the number of test cases . Each of the next lines contains four integers .
Output
For each test case print on a separate line the number of ways an ant can reach the bottom right corner under the given conditions. Print the answer modulo .
Examples
Input #1
Answer #1
Submissions 48
Acceptance rate 27%