Facing timeout problem in hackerblocks

https://ide.codingblocks.com/s/46934

my code of the problem prateek loves candies of hackerblocks

Hey Vishesh, as the constraints are large for this problem so your are supposed to use Sieve of Eratosthenes for finding the Nth prime number.