eolymp
Competitions

Биномиальный коэффициент

The Uncountable Ways

There is a rectangle of n * m units. Another rectangle of a * b 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 t. Each of the next t lines contains four integers n, m, a, b (2n, m400000, 1a < n, 1b < m).

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.

prb11270.gif

Time limit 1 second
Memory limit 128 MiB
Input example #1
3
2 2 1 1
4 5 2 2
7 7 6 6
Output example #1
5
105
50