#include <iostream>
#include <omp.h>
#include <cmath>
using namespace std;
// Function to check if a number is prime
bool is_prime(int n) {
if (n < 2) return false;
for (int i = 2; i <= sqrt(n); ++i) {
if (n % i == 0) return false;
}
return true;
}
int main() {
int n = 100; // Check first 100 odd integers
int count = 0;
#pragma omp parallel for reduction(+:count)
for (int i = 3; i < n; i += 2) {
if (is_prime(i) && is_prime(i + 2)) {
count++;
}
}
cout << "Number of prime pairs: " << count << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8b21wLmg+CiNpbmNsdWRlIDxjbWF0aD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCi8vIEZ1bmN0aW9uIHRvIGNoZWNrIGlmIGEgbnVtYmVyIGlzIHByaW1lCmJvb2wgaXNfcHJpbWUoaW50IG4pIHsKICAgIGlmIChuIDwgMikgcmV0dXJuIGZhbHNlOwogICAgZm9yIChpbnQgaSA9IDI7IGkgPD0gc3FydChuKTsgKytpKSB7CiAgICAgICAgaWYgKG4gJSBpID09IDApIHJldHVybiBmYWxzZTsKICAgIH0KICAgIHJldHVybiB0cnVlOwp9CgppbnQgbWFpbigpIHsKICAgIGludCBuID0gMTAwOyAvLyBDaGVjayBmaXJzdCAxMDAgb2RkIGludGVnZXJzCiAgICBpbnQgY291bnQgPSAwOwoKICAgICNwcmFnbWEgb21wIHBhcmFsbGVsIGZvciByZWR1Y3Rpb24oKzpjb3VudCkKICAgIGZvciAoaW50IGkgPSAzOyBpIDwgbjsgaSArPSAyKSB7CiAgICAgICAgaWYgKGlzX3ByaW1lKGkpICYmIGlzX3ByaW1lKGkgKyAyKSkgewogICAgICAgICAgICBjb3VudCsrOwogICAgICAgIH0KICAgIH0KCiAgICBjb3V0IDw8ICJOdW1iZXIgb2YgcHJpbWUgcGFpcnM6ICIgPDwgY291bnQgPDwgZW5kbDsKICAgIHJldHVybiAwOwp9Cg==