Doubt it said time exeed

prateek loves candy problem
i have solved the question but when i submitted this it said exeeds time limit here is my solution

@nimishkhattar07 hey nimish this is because the constraints of this problem is so high and this can’t be solved by the simple approach. so there is a video in our course content name as sieve of erthothenes go and watch that video you will get to know how to approach this question.

the link has changed to thishttps://ide.codingblocks.com/s/90524

@nimishkhattar07 hey nimish I am extremely sorry for this delay
this approach will not work try with the sieve of erthothanes

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.