#P11212. Prime Queries with Modulo Primes

    ID: 13280 Type: Default 1000ms 256MiB

Prime Queries with Modulo Primes

Prime Queries with Modulo Primes

Given q queries, each query provides a positive integer \(n\). For each query, count the number of positive integers \(i\) (where \(1 \le i \le n\)) such that both \(i\) and \(n \bmod i\) are prime numbers.

Note: A prime number is defined as a natural number greater than 1 that has no positive divisors other than 1 and itself.

inputFormat

The input begins with an integer \(q\), the number of queries.

Each of the following \(q\) lines contains a single positive integer \(n\).

outputFormat

For each query, output a single line containing the count of integers \(i\) such that both \(i\) and \(n \bmod i\) are prime numbers.

sample

3
6
7
11
0

1 1

</p>