#SP0000261. Các số nguyên tố giả (Phony Primes)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Các số nguyên tố giả (Phony Primes)
Phony Primes
Source: SPOJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given an integer interval , an integer in this interval is called a phony prime if all of the following hold:
- is odd.
- is a product of at least three distinct primes, each appearing exactly once: with .
- For each prime divisor of , divides .
For example, and is divisible by , so is valid. List every valid number in in increasing order.
Input
One line containing the two integers and .
Output
Print each phony prime in on a separate line, in increasing order. If none exists, print exactly none in lowercase.
Subtasks
- Subtask 1 (20 points): ; .
- Subtask 2 (30 points): ; .
- Subtask 3 (50 points): ; .
Examples
Example 1
Input
10 2000
Output
561
1105
1729
Explanation
The qualifying integers are , , and . For , the number is divisible by ; for , the number is divisible by ; and for , the number is divisible by . Each is odd and is a product of three distinct primes. Checking the remaining numbers in the interval yields no other valid integer. Print the three answers in increasing order.
Example 2
Input
20000 21000
Output
none
Explanation
No integer in this interval satisfies every required condition, so print none.