#include #include #include using namespace std; int IsPrime (int n) { int i; if (n < 2){ return 0; }else if (n == 2){ return 1; } if (n % 2 == 0){ return 0; } double sqrtNum = sqrt((double)n); for (i = 3; i <= sqrtNum; i += 2){ if (n % i == 0 ){ return 0; } } return 1; } int main(int argc, char* argv[]) { int N; cin>>N; int i,j,k; int ans=0; vector Prime; for (i=3;i<=N;i+=2){ if (IsPrime(i)){ Prime.push_back(i); } } for (i=0;i