Problem D. Integer Partition

时间限制 1000 ms   内存限制 32 MB

Given n, k, calculate the number of different (unordered) partitions of n such that no part is repeated k or more times.
 

输入数据

First line, number of test cases, T.
Following are T lines. Each line contains two numbers, n and k.

1<=n,k,T<=10 5
 

输出数据

T lines, each line contains answer to the responding test case.
Since the numbers can be very large, you should output them modulo 10 9+7.
 

样例输入

复制
4
4 2
4 3
4 4
4 5

样例输出

复制
2
4
4
5

提交

请先 登录

© 2025 FAQs Contact About