PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000166. Số T-nguyên tố (T-primes)
HỌC THEO LỘ TRÌNH
2 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Số T-nguyên tố (T-primes)
T-primes
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
A positive integer is called a T-prime if it has exactly three distinct positive divisors. Given positive integers , determine independently for each number whether it is a T-prime. Preserve the original order.
Input
The first line contains . The next line contains positive integers .
Output
Print lines, YES for a T-prime and NO otherwise, in the same order.
Subtasks
- Subtask 1 (20 points): ; .
- Subtask 2 (30 points): ; .
- Subtask 3 (50 points): ; .
Examples
Input
5
4 9 25 6 1
Output
YES
YES
YES
NO
NO
Explanation
has divisors ; has ; has , so each has exactly three. The number has four divisors, and has only one.