시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 512 MB | 193 | 125 | 92 | 63.889% |
The Slivians are afraid of factoring; it’s just, well, difficult.
Really, they don’t even care about the factors themselves, just how much they sum to.
We can define F(n) as the sum of all of the factors of n; so F(6) = 12 and F(12) = 28. Your task is, given two integers a and b with a ≤ b, to calculate
\[S=\sum_{a \le n \le b}{F(n)}\]
The input consists of a single line containing space-separated integers a and b (1 ≤ a ≤ b ≤ 1012; b − a ≤ 106).
Print S on a single line.
101 101
102
28 28
56
1 10
87
987654456799 987654456799
987654456800
963761198400 963761198400
5531765944320
5260013877 5260489265
4113430571304040