当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

7217:Counting Good Arrays

题目描述
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$.
输入解释
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$.
输出解释
For each test case, output the answer modulo $10^9+7$ in a single line.
输入样例
5
2 4
3 5
10 12
24 17
114514 1919810
输出样例
12
31
3915
190204
13530870
来自杭电HDUOJ的附加信息
Hint All the good arrays with $n=2,m=4$ are: $\{1\},\{2\},\{3\},\{4\}$ $\{1,1\},\{1,2\},\{1,3\},\{1,4\}$ $\{2,2\},\{2,4\}$ $\{3,3\}$ $\{4,4\}$

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-7217

最后修改于 2022-09-15T06:17:27+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
12000/6000MS(Java/Others) 524288/524288K(Java/Others)