Chiaki Chain Counting

아직 제출이 없습니다시간 제한1.5초메모리 제한256 MB

문제

An ordinary chain is a graph consisting of sequential (at least two) vertices. Every two adjacent vertices are connected by an edge. The kk-th order Chiaki Chain looks slightly different from a chain. There are kk sub-chains of various lengths extended from kk different vertices on the main chain. At the other side of each sub-chain, there is a simple cycle of length 3,4,,k+23, 4, \ldots, k + 2 respectively. There is no useless vertices or edges on the kk-th order Chiaki Chain.

Note that the main chain and the sub-chains should consist of at least two vertices.

The following image corresponds to the a 33-rd order Chiaki Chain with 2020 vertices and 2222 edges:

Given nn, mm and kk, Chiaki would like to know the number of labelled kk-th order Chiaki Chain with nn vertices and mm edges. Since this number may be very large, you are only asked to calculate it modulo 109+710^9+7.

입력

There are multiple test cases. The first line of the input contains an integer TT (1T1051 \le T \le 10^5), indicating the number of test cases. For each test case:

The first line contains three integers nn, mm and kk (1n,m,k1061 \le n, m, k \le 10^6) --- the number of vertices and the number of edges in the graph and the order of Chiaki Chain.

출력

For each test case, output an integer denoting the answer.