3075: Gift

时间限制:1000 ms 内存限制:128 MB
上传者:
提交:1 通过:1

题目描述

Labor Day is coming. Boss Niu has prepared nn identical gifts for his staff generously, and all of the gifts will be given away. It is known that in Boss Niu's company, there are mm staff in total. Due to limited gifts, each of the staff can get at least one gift, and at most kk gifts.

Now Boss Niu wonders how many different ways can he distribute his gifts. Two ways are considered different if exists one staff at least, who gets xx gifts in the first way and gets yy gifts in the second way(xyx\neq y). Please note that all the gifts are considered same.

Since the answer may be large, you only need to output it modulo 100000007100000007.

输入格式

The first line contains an integer number T, the number of test cases.

ithi^{th} of each next T lines contains three integers nn, mm, kk(1m,kn1051 \leq m, k \leq n \leq 10^{5}), the number of gifts, the number of staff and the maximum number of gifts each staff can get.

输出格式

For each test case print the answer.

输入样例 复制

4
6 3 2
6 3 3
6 3 1
666 233 3

输出样例 复制

1
7
0
2726237