PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000085. Đếm số DePrime (Count DePrimes)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Đếm số DePrime (Count DePrimes)
Count DePrimes
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
A positive integer is a DePrime when the sum of its distinct prime divisors is prime. For example, gives , and gives ; both are DePrimes. Given , count the DePrimes in the inclusive range .
Input
One line contains two integers .
Output
Print the number of DePrimes in .
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
10 21
Output
9
Explanation
The DePrimes in are . In particular, contributes the single distinct prime divisor and qualifies; gives the composite sum . Thus the answer is .