|
||||||||||
Integer PartitionTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1193 Accepted Submission(s): 638 Problem Description Given n, k, calculate the number of different (unordered) partitions of n such that no part is repeated k or more times. Input First line, number of test cases, T. Following are T lines. Each line contains two numbers, n and k. 1<=n,k,T<=105 Output T lines, each line contains answer to the responding test case. Since the numbers can be very large, you should output them modulo 109+7. Sample Input
Sample Output
Source | ||||||||||
|