Prateek loves candy TLE error

code link : https://ide.codingblocks.com/s/176044

You are supposed to use prime seive optimisation in your code to prevent TLE…you can refer to the online lecture of it and then try to implement the logic …