PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000076. Các số có đúng k ước nguyên tố phân biệt (N-Factorful)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Các số có đúng k ước nguyên tố phân biệt (N-Factorful)
N-Factorful
Source: SPOJ
Version: Phuoc Hung OJ Extended
Problem Statement
A positive integer is -factorful if it has exactly distinct prime divisors. For instance, is -factorful because its distinct prime divisors are . By convention, is -factorful. Given , count the integers in the inclusive range having exactly distinct prime divisors.
Input
One line contains three integers , in that order.
Output
Print the number of -factorful integers in .
Subtasks
- Subtask 1 (20 points): ; .
- Subtask 2 (30 points): ; .
- Subtask 3 (50 points): ; .
Examples
Input
1 10 2
Output
2
Explanation
In , the values and have exactly two distinct prime divisors. Numbers have only one, and has none. The answer is therefore .