123456789101112131415161718192021 |
- import java.util.Scanner;
- public class J {
- static boolean check(int n) {
- int tot = 0;
- for (int i = 2; i < n; i++)
- if (n % i == 0)
- ++tot;
- return tot <= 2 && tot > 0;
- }
- public static void main(String[] args) {
- Scanner cin = new Scanner(System.in);
- for (int t = cin.nextInt(); t-- > 0; ) {
- if (check(cin.nextInt()))
- System.out.println("Yes");
- else
- System.out.println("No");
- }
- }
- }
|