Problem in submission on codeforces


https://codeforces.com/contest/978/problem/C

Sir, I am getting right answer when I execute in my terminal but wrong on codeforces can you point out where I am going wrong because its giving out of bounds.

This is giving wrong output on sample input output as well, try to dry run your code first

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.