Test case 1 is not passing

i have used sieves of eratosthenes in this question, but one of the test case is not passing, i had also tried to increase the size of sieves but then it starts throwing TLE. please suggest me some way to solve this question or some other ways to solve question like this.

thank you

Hey @chauhanchp
Did you try using long long int instead of int, coz n is big here and nth prime number can be very large , try this and tell me if yor code works, if not, post your code and the test case number which is not working