7590: Absolute Math

内存限制:262 MB 时间限制:50 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:0 通过:0

题目描述

Let f(n)=d|n|μ(d)| , where μ(d) is Mobius function .
Output mi=1f(ni) .

输入格式

The first line contains an integer T(1T104) - the number of test cases.

Each line of the following T lines contains two integers n,m(1n,m107) .

输出格式

Print the answer modulo 109+7 for each test case

输入样例 复制

3
6 3
6 2
1 4

输出样例 复制

12
8
7