8632: Counting Good Arrays

内存限制:128 MB 时间限制:6 S
题面:传统 评测方式:文本比较 上传者:
提交:2 通过:1

题目描述

We consider an array consisting of positive integersa1,a2,,an of length n is good if and only if for each ai+1 is divisible by ai. Please note that we consider all the arrays with length 1 are good.

Given two integers n and mm, please count the number of good arrays whose length is no greater than n and whose largest element is no greater than mm. Since the answer may be large, you just need to output the answer modulo 109+7.

输入格式

The first line of the input contains a single integer T (1T103), denoting the number of test cases.

Each of the next T lines contains two integers n,m (1n,m109), denoting a test case.

It's guaranteed that the number of test cases satisfying max(n,m)>103 will not exceed 50, the number of test cases satisfying max(n,m)>106 will not exceed 10, and the number of test cases satisfying max(n,m)>108 will not exceed 1.

输出格式

For each test case, output the answer modulo 109+7 in a single line.

输入样例 复制

5
2 4
3 5
10 12
24 17
114514 1919810

输出样例 复制

12
31
3915
190204
13530870