Gửi bài giải
Điểm:
1,00 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
256M
Input:
stdin
Output:
stdout
Nguồn bài:
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
In arithmetic, an abundant number is a number whose sum of its proper divisors (excluding itself) is greater than the number itself.
For example: the number ~12~ has the sum of its proper divisors (excluding ~12~) as ~1 + 2 + 3 + 4 + 6 = 16 > 12~. Therefore, ~12~ is an abundant number.
You need to write a program to count how many abundant numbers are in the range ~[L, R]~.
Input
- The input consists of two integers ~L, R~ ~(1 ≤ L ≤ R ≤ 10^7)~.
Output
- The output should be a single integer, the count of abundant numbers in the range ~[L, R]~.
Sample Input
1
50
Sample Output
9
Note
- From ~1~ to ~50~, there are ~9~ abundant numbers: ~12, 18, 20, 24, 30, 36, 40, 42, 48~.
Bình luận