Prime visits TLE 3rd case

Plz use prime seive for prime nos in your code, the explanation of prime seive is given in online lectures


still not working…last case giving runtime error rest cases are working fine.


I have corrected your code a bit, firstly use long long int instead of int and also make that you call the primeseive before the test cases, since it will increase time complexity