#include<bits/stdc++.h>
#define int long long
using namespace std;
int n;
int solve(){
int ans = n;
for (int i = 2; i * i <= n; i ++ )
if (n % i == 0) {
int b = 0;
while (n % i == 0) ++ b, n /= i;
ans /= i;
ans *= b * i - b + i;
}
if (n > 1) ans /= n, ans *= n + n - 1;
return ans;
}
signed main(){
scanf("%lld", &n);
printf("%lld", solve());
}
P2303 [SDOI2012] Longge 的问题
最新推荐文章于 2024-11-05 17:24:02 发布