Deepak and Primes question in Number theory section

my solution link is – https://ide.codingblocks.com/s/34955

problem link is – https://online.codingblocks.com/player/8634/content/5057?tab=leaderboard

I am getting wrong answer for 3 testcases and right answer for 3 testcases. Please tell me what is wrong in my code.

Actually in your code you are making sieve just for
N=100005

But according to the constraints mentioned in question, 1<=n<=5000000

So you need to make sieve for a bigger number. Make the sieve for larger value, and just return value corresponding to the n entered by the user.