AtCoder Beginner Contest 172
翻译中…
Problem Statement
翻译中…
For a positive integer $X$, let $f(X)$ be the number of positive divisors of $X$.
翻译中…
Given a positive integer $N$, find $\sum_{K=1}^N K\times f(K)$.
翻译中…
Constraints
翻译中…
$1 \leq N \leq 10^7$
翻译中…
Input
翻译中…
Input is given from Standard Input in the following format:
翻译中…
N
翻译中…
Output
翻译中…
Print the value $\sum_{K=1}^N K\times f(K)$.
翻译中…
样例
Input #1
4
Output #1
23
We have $f(1)=1$, $f(2)=2$, $f(3)=2$, and $f(4)=3$, so the answer is $1\times 1 + 2\times 2 + 3\times 2 + 4\times 3 =23$.
Input #2
100
Output #2
26879
Input #3
10000000
Output #3
838627288460105
Watch out for overflows.
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。