|
||||||||||
Counting Good ArraysTime Limit: 12000/6000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 269 Accepted Submission(s): 131 Problem Description We consider an array consisting of positive integers $\{a_1, a_2, \ldots, a_n\}$ of length $n$ is good if and only if for each $1 \leq i < n$, $a_{i+1}$ is divisible by $a_i$. Please note that we consider all the arrays with length $1$ are good. Given two integers $n$ and $m$, please count the number of good arrays whose length is no greater than $n$ and whose largest element is no greater than $m$. Since the answer may be large, you just need to output the answer modulo $10^9+7$. Input The first line of the input contains a single integer $T$ ($1 \leq T \leq 10^3$), denoting the number of test cases. Each of the next $T$ lines contains two integers $n,m$ ($1 \leq n,m \leq 10^9$), denoting a test case. It's guaranteed that the number of test cases satisfying $\max(n,m) > 10^3$ will not exceed $50$, the number of test cases satisfying $\max(n,m) > 10^6$ will not exceed $10$, and the number of test cases satisfying $\max(n,m) > 10^8$ will not exceed $1$. Output For each test case, output the answer modulo $10^9+7$ in a single line. Sample Input
Sample Output
Hint All the good arrays with $n=2,m=4$ are:
Source | ||||||||||
|