T-primes

题意翻译

## 题目描述 我们知道质数是只有两个不同的正数因数的正整数。相似的,我们把一个正整数 _t_ 叫做 T质数,如果 _t_ 恰好有三个不同的正整数因数。 你被给了一个含有 _n_ 个正整数的数组。你要给其中所有的数判断它是否是 T质数。 ## 输出输入格式 ### 输入格式: 第一行只有一个正整数, _n_ (1<= _n_ <=10⁵),代表数组里有几个数字。下一行包含了 _n_ 个被空格分开了的整数 _Xᵢ_ (1<=Xᵢ<=10¹²)。 请勿在C++中使用 %lld 用来读写64位整数。建议使用cin、cout流或 %I64d。 ### 输出格式: 输出 _n_ 行:如果第 _i_ 行的数 _Xᵢ_ 是T质数,则输出YES,否则输出NO。 ## 说明 给定样例有三个数。第一个数4恰好有三个因数--1、2和4,因此对这个数字输出YES。第二个数5有两个因数(1和5),第三个数6有四个因数(1、2、3和6),因此这两个数的答案是NO。

题目描述

We know that prime numbers are positive integers that have exactly two distinct positive divisors. Similarly, we'll call a positive integer $ t $ Т-prime, if $ t $ has exactly three distinct positive divisors. You are given an array of $ n $ positive integers. For each of them determine whether it is Т-prime or not.

输入输出格式

输入格式


The first line contains a single positive integer, $ n $ ( $ 1<=n<=10^{5} $ ), showing how many numbers are in the array. The next line contains $ n $ space-separated integers $ x_{i} $ ( $ 1<=x_{i}<=10^{12} $ ). Please, do not use the %lld specifier to read or write 64-bit integers in С++. It is advised to use the cin, cout streams or the %I64d specifier.

输出格式


Print $ n $ lines: the $ i $ -th line should contain "YES" (without the quotes), if number $ x_{i} $ is Т-prime, and "NO" (without the quotes), if it isn't.

输入输出样例

输入样例 #1

3
4 5 6

输出样例 #1

YES
NO
NO

说明

The given test has three numbers. The first number 4 has exactly three divisors — 1, 2 and 4, thus the answer for this number is "YES". The second number 5 has two divisors (1 and 5), and the third number 6 has four divisors (1, 2, 3, 6), hence the answer for them is "NO".