A Prime Problem
Answer the following \(Q\) queries:
Count the number of prime numbers in the range \([A, B]\).
The first line of the input will contain an integer \(Q\) \((1 \le Q \le 100)\), indicating the number of queries.
The next \(Q\) lines will each contain two integers \(A_i\) and \(B_i\), where \(1 \le A_i \le B_i \le 10^6\).
Output \(Q\) lines, where the \(i\)-th line represents the number of prime numbers in the range \([A_i, B_i]\).
2 2 17 1 4
The \(7\) prime numbers in the given range are \(2\), \(3\), \(5\), \(7\), \(11\), \(13\), and \(17\).
The \(2\) prime numbers in the range \([1, 4]\) are \(2\) and \(3\).