# [SDOI2015][bzoj3994] 约数个数和 [莫比乌斯反演]

(pi^ai,1) (pi^(ai-1),1) ..... (1,1) .....(1,pi^(bi-1)) (1,pi^bi)

Code：

 1 #include<iostream>
2 #include<cstdio>
3 #include<cstring>
4 #include<algorithm>
5 #define ll long long
6 using namespace std;
7 inline ll read(){
8     ll re=0,flag=1;char ch=getchar();
9     while(ch>'9'||ch<'0'){
10         if(ch=='-') flag=-1;
11         ch=getchar();
12     }
13     while(ch>='0'&&ch<='9') re=(re<<1)+(re<<3)+ch-'0',ch=getchar();
14     return re*flag;
15 }
16 ll mu[100010],pri[100010],c[100010],d[100010],cnt;bool vis[100010];
17 void init(ll n){
18     mu[1]=d[1]=c[1]=1;ll i,j,k;
19     for(i=2;i<=n;i++){
20         if(!vis[i]){
21             pri[++cnt]=i;mu[i]=-1;c[i]=1;d[i]=2;
22         }
23         for(j=1;(j<=cnt)&&(i*pri[j]<=n);j++){
24             k=i*pri[j];vis[k]=1;
25             if(i%pri[j]==0){
26                 d[k]=d[i]/(c[i]+1)*(c[i]+2);
27                 c[k]=c[i]+1;break;
28             }
29             mu[k]=-mu[i];
30             d[k]=d[i]*d[pri[j]];c[k]=1;
31         }
32     }
33     for(i=1;i<=n;i++) mu[i]+=mu[i-1];
34     for(i=1;i<=n;i++) d[i]+=d[i-1];
35 }
36 ll n,m;
37 int main(){
39     while(T--){
48 }