A function f(x,y) is defined as
f(x,y)=(xy) if x≥y else x x y
where (xy)=x!y!(x−y)!
There will be total q queries and each query will have four integers i.e. a, b, c and d. You need to compute the value of
∑bi=a∏dj=c f(i,j) for every query.
As the output number can be very large. So, you need to print answer modulo 109+7
Note: 0!=1
Input Format
Output Format
Constraints
For Case 1, we need to find f(0,0) x f(0,1) = 1 x 0 = 0
For Case 2, we need to find f(4,1) x f(4,2) + f(5,1) x f(5,2) = 4 x 6 + 5 x 10 = 24 + 50 = 74
For Case 3, we need to find f(4,5) x f(4,6) + f(5,5) x f(5,6) = 20 x 24 + 1 x 30 = 480 + 30 = 510