-->
当前位置:首页 > 题库

PROGRAMMING:Fear Factoring

Luz5年前 (2021-05-10)题库546
The Slivians are afraid of factoring; it's just, well, difficult.
The slavians fear decomposition; It's just, it's good, it's hard.
Really, they don't even care about the factors themselves, just how much they sum to.
Indeed, they don't even care about the factors themselves, they just care about the sum of them.
We can define F(n) as the sum of all of the factors of nn; so F(6) = 12 and F(12)=28. Your task is, given two integers a and b with a ≤b, to calculate S = ∑(a≤n≤b) F(n)
We define f (n) as the sum of factors of N, so f (6) = 12 and f (12) = 28. Let a and B find the sum of factors of all numbers in the interval a and B
###Input format:
The input consists of a single line containing space-separated integers a and b(1<=a<=b<=10^12); b-a<=10^6;
Give a, B in one line
###Output format:
Print S on a single line.
Output factor and S
###Input example:
Here is a set of inputs. For example:
```in
101 101
28 28
1 10
987654456799 987654456799
963761198400 963761198400
5260013877 5260489265
```
###Output example:
The corresponding output is given here. For example:
```out
one hundred and two
fifty-six
eighty-seven
nine hundred and eighty-seven billion six hundred and fifty-four million four hundred and fifty-six thousand and eight hundred
five trillion and five hundred and thirty-one billion seven hundred and sixty-five million nine hundred and forty-four thousand three hundred and twenty
four thousand one hundred and thirteen trillion and four hundred and thirty billion five hundred and seventy-one million three hundred and four thousand and forty
```







answer:If there is no answer, please comment