PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000113. Nguyên tố theo số thừa số nguyên tố (Prime-Factor Prime)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Nguyên tố theo số thừa số nguyên tố (Prime-Factor Prime)
Prime-Factor Prime
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
Factor each positive integer into primes, counting repeated factors. Let be the total number of prime factors with multiplicity; for instance has , while . An integer is prime-factor prime if is itself prime. Count such integers in the closed interval .
Input
One line contains integers .
Output
Print one integer: the number of for which is prime.
Subtasks
- Subtask 1 (20 points): ; .
- Subtask 2 (30 points): ; .
- Subtask 3 (50 points): ; .
Examples
Input
1 9
Output
4
Explanation
The four qualifying numbers in are (two factors), (two), (three), and (two). Because and are prime, print .