#include #include #include using namespace std; #define REP(i,first,last) for (int i=first;i prime_factorization(long n) { int sqrt_n = sqrt(n); vector prime_check_list(sqrt_n + 1, true); vector primes; prime_check_list[0] = false; prime_check_list[1] = false; for (int i=2;i<=sqrt_n;i++) { if (prime_check_list[i]) { for (int j=i*2;j> N; vector primes = prime_factorization(N); cout << (primes.size() >= 3 ? "YES" : "NO") << endl; }