Prateek Loves Candy Time limit Err

I am using sieve than also i am getting TLE.

hey @srijan44, sieve has all the numbers form 0 to 10000001. For every testcase program is check all these numbers till count becomes equal to n.

While making sieve, maintain an array the will contain only prime number, like 1 index of this array contains 2, 2 index of this array contains 3, similarly goes on. And for for every test case check this new array only instead of complete prime sieve.