Prime visits question

its giving one wrong answer, check it pls

@sktg99
Since the constraints are extremely large , you need to use an optimised approach to solve this problem . You should use Sieve technique to precompute the primes and then answer the queries. This technique has been discussed in detail in the Number Theory Section of your course. Kindly refer to it.