There are m persons and n chairs. Each person needs to maintain social distance between themselves and the person they are sitting next to. Therefore, once a person sits, the person who sits next to them sits at a distance that is in multiples of the integer k.
Your task is to find the total number of arrangements possible so that all the people can be seated. Print your answer modulo 109+7.
Notes
Input format
The first line contains an integer t representing the number of test cases.
Each of the next t lines contains three integers n, m, and k.
Output format
Print ti ntegers where the ith integer is the total number of arrangements for the ithtest case.
Constraints
1≤t≤105
1≤n,m,k≤106
In the first test case, total 4 arrangements are possible. Let 5 chairs are numbered from 1 to 5, then arrangements for 2 persons are {1,3}, {1,5}, {2,4} and {3, 5}.
In the second test case, only 1 arrangement is possible.