#P10720. [GESP202406 五级] 小杨的幸运数字
[GESP202406 五级] 小杨的幸运数字
Background
Corresponding multiple-choice and true/false problems: https://ti.luogu.com.cn/problemset/1153.
Problem Description
Xiao Yang believes that his lucky number should have exactly two distinct prime factors. For example, has prime factors , which are exactly two distinct prime factors, so is a lucky number. However, has prime factors , which does not meet the requirement, so it is not a lucky number.
Xiao Yang now has positive integers, and he wants to know whether each positive integer is his lucky number.
Input Format
The first line contains a positive integer , representing the number of positive integers.
The next lines each contain one positive integer.
Output Format
Output lines. For each positive integer, if it is a lucky number, output ; otherwise output .
3
7
12
30
0
1
0
Hint
Sample Explanation
The prime factors of are , which is only one kind.
The prime factors of are , which is exactly two kinds.
The prime factors of are , which is three kinds.
Constraints
| Subtask ID | Percentage | Range of positive integers | |
|---|---|---|---|
For all testdata, it is guaranteed that , and each positive integer satisfies .
Translated by ChatGPT 5