bool isp[N];
vector<int> primes;
void sieve() {
for (int i = 0; i < N; i++)
isp[i] = true;
isp[0] = isp[1] = false;
for (int i = 4; i < N; i += 2)
isp[i] = false;
for (int i = 3; i * i < N; i += 2)
if (isp[i])
for (int j = i + i; j < N; j += i)
isp[j] = false;
}