What is the issue with my code?

https://ide.codingblocks.com/s/202598 I have used sieve to calculate the primes and then i have used basic stack operations to get the desired result and the given test case works fine.

@tusharnitharwal change the size of sieve to match the constraints given in the question

it gives run error when i increase the range of the sieve

any help with this issue?

@tusharnitharwal can you share the modified code? It cant give run error on just changing the sieve size?

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.