ll go(ll n)
{
return n*(n+1)/2;
}
ll G(int n)
{
ll ans=0;
for(ll l=1,r;l<=n;l=r+1){
r=n/(n/l);
ans+=(go(r)-go(l-1))*(n/l);
}
return ans;
}
int main()
{
while(~sd(n)){
pll(G(G(n)));
}
}
2024-04-12 07:57:32
ll go(ll n)
{
return n*(n+1)/2;
}
ll G(int n)
{
ll ans=0;
for(ll l=1,r;l<=n;l=r+1){
r=n/(n/l);
ans+=(go(r)-go(l-1))*(n/l);
}
return ans;
}
int main()
{
while(~sd(n)){
pll(G(G(n)));
}
}