This code for Grand temple problem is working for small values but giving RE after submission

Hi Sasi. Actually i take doubts only in C++. So u can close this doubt and raise a new doubt. For reference u can see this code https://ide.codingblocks.com/s/585048 it is in c++

Okay, but there should be someone else who can take my doubts in python, because it was mentioned that i can code in python in challenges.

yes. that is what i am saying. u can close this doubt and raise it again. someone else will take up ur doubt

Oh ok, sorry I misunderstood,
Thank you

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.

How do i close the doubt?

I have done that. u can raise a new doubt now