3482 - An Interesting List

Created by Luis Manuel Díaz Barón
Added by luismo (2015-12-05)
Limits
Total Time: 8000 MS | Test Time: 6000 MS |Memory: 512 MB | Output: 64 MB | Size: 9 KB
Enabled languages
Available in

Description

Given a set of N (1 <= N <= 10^3) integers containing the numbers from 1 to N. We would like to know how many lists of length L (1 <= L <= 10^3) can be formed using elements from the set such that the difference between two adjacent elements in the list is always lower or equal than M (1 <= M <= 10^3).
Given a set of N (1 <= N <= 10^3) integers containing the numbers from 1 to N. We would like to know how many lists of length L (1 <= L <= 10^3) can be formed using elements from the set such that the difference between two adjacent elements in the list is always lower or equal than M (1 <= M <= 10^3).
Given a set of N (1 <= N <= 10^3) integers containing the numbers from 1 to N. We would like to know how many lists of length L (1 <= L <= 10^3) can be formed using elements from the set such that the difference between two adjacent elements in the list is always lower or equal than M (1 <= M <= 10^3).

Input specification

In the first line a single integer T, the number of testcases (no more than 10)
Each of the next T lines contain three space separated integers N, L and M.

In the first line a single integer T, the number of testcases (no more than 10)
Each of the next T lines contain three space separated integers N, L and M.

In the first line a single integer T, the number of testcases (no more than 10)
Each of the next T lines contain three space separated integers N, L and M.

Output specification

For each testcase print the answer modulus 10^9 + 7
For each testcase print the answer modulus 10^9 + 7
In the first line a single integer T, the number of testcases (no more than 10)
Each of the next T lines contain three space separated integers N, L and M.

Sample input

1
3 3 1

Sample output

17

Hint(s)

http://coj.uci.cu/contest/
http://coj.uci.cu/contest/
http://coj.uci.cu/contest/