Wrong ans in one test case
@shivamgoel150 you are checking primes upto 10^5 but it is mentioned in the input format that answer can be upto 10^6, so check and store prime numbers upto 10^6.
@shivamgoel150 you are checking primes upto 10^5 but it is mentioned in the input format that answer can be upto 10^6, so check and store prime numbers upto 10^6.