# 题目链接

https://lydsy.com/JudgeOnline/problem.php?id=3994

# 题解

$\sum_{k=1}^{n} \mu(k)\sum_{i=1}^{\lfloor n/k\rfloor}\sigma_0(i)\sum_{i=1}^{\lfloor n/k\rfloor}\sigma_0(i)$

# 代码

#include <cstdio>
#include <algorithm>

{
int x=0,f=1;
char ch=getchar();
while((ch<'0')||(ch>'9'))
{
if(ch=='-')
{
f=-f;
}
ch=getchar();
}
while((ch>='0')&&(ch<='9'))
{
x=x*10+ch-'0';
ch=getchar();
}
return x*f;
}

const int maxn=50000;

int p[maxn+10],prime[maxn+10],cnt,mu[maxn+10],low[maxn+10],num[maxn+10],d[maxn+10];

int getprime()
{
p[1]=mu[1]=d[1]=num[1]=1;
low[1]=0;
for(int i=2; i<=maxn; ++i)
{
if(!p[i])
{
prime[++cnt]=i;
mu[i]=-1;
low[i]=1;
num[i]=1;
d[i]=2;
}
for(int j=1; (j<=cnt)&&(i*prime[j]<=maxn); ++j)
{
int x=i*prime[j];
p[x]=1;
if(i%prime[j]==0)
{
mu[x]=0;
low[x]=low[i]+1;
num[x]=num[i];
d[x]=d[num[x]]*(low[x]+1);
break;
}
mu[x]=-mu[i];
low[x]=1;
num[x]=i;
d[x]=d[i]*2;
}
}
for(int i=1; i<=maxn; ++i)
{
d[i]+=d[i-1];
}
for(int i=1; i<=maxn; ++i)
{
mu[i]+=mu[i-1];
}
return 0;
}

int T,n,m;

int main()
{
getprime();
while(T--)
{