F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Absolute Math

Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)
Total Submission(s): 686    Accepted Submission(s): 178


Problem Description
Let $f(n)=\sum_{d|n} |\mu(d)|$, where $\mu(d)$ is Mobius function .
Output $\sum_{i=1}^m f(ni)$.
 

Input
The first line contains an integer $T(1\leq T\leq 10^4)$ - the number of test cases.

Each line of the following $T$ lines contains two integers $n,m (1\leq n,m \leq 10^7)$.
 

Output
Print the answer modulo $10^9+7$ for each test case.
 

Sample Input
3 6 3 6 2 1 4
 

Sample Output
12 8 7
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-26 17:40:35, Gzip enabled