sir this is the editorial code
still it is not passing one test case
Prime visits problem
@qudsiya maybe there is some mistake in the editorial here
You have to use Sieve of Eratosthenes for primes in this problem. The test cases are large and so without this it will give TLE. Lecture video of Sieve of Eratosthenes is there in the Number Theory section of your course. Please refer that first and then try to solve this problem using that concept.
You can refer this: