About time limit excceds

Prateek Loves Candy
https://ide.codingblocks.com/s/50973

Hey Shubham, as the constraints are large for this problem you are supposed to use Sieve of Eratosthenes in this problem to reduce the time complexity.