No.2751 429-like Number
Problem Statement
Yozakura Shaniku, also known as Yoniku, likes $429$.
Yoniku suddenly noticed that it can be factorized into primes as $429=3\times 11\times 13$.
He decided to call a positive integer that has exactly $3$ prime factors, like this $429$, a 429-like Number. Here, prime factors are counted with multiplicity.
Yoniku became curious whether other positive integers are also 429-like Numbers.
Given $Q$ positive integers $A_1,A_2,\dots,A_Q$, determine for him whether each of them is a 429-like Number.
Input
The input is given from standard input in the following format.$Q$ $A_1$ $A_2$ $\vdots$ $A_Q$
- $1\leq Q\leq 10^4$
- $1\leq A_i\leq 10^{10}$
- All input values are integers.
Output
Print $Q$ lines in total.
On the $i$-th line, print Yes if $A_i$ is a 429-like Number, and No if it is not a 429-like Number.
Also, print a newline at the end.
Sample
Sample 1
Input
1 429
Output
Yes
As stated in the problem statement, $429=3\times 11\times 13$, so $429$ is a 429-like Number.
Sample 2
Input
9 1 2 3 4 5 6 7 8 9
Output
No No No No No No No Yes No
Among 1-digit positive integers, only $8$ is a 429-like Number.
Sample 3
Input
1 4294967298
Output
Yes
Input values may not fit in a 32bit integer type.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。