Need help with a runtime error

Revision en1, by I_am_Mahi, 2025-02-02 09:42:38

I wrote a code for the solution to the problem C-Berland Regional but I am getting runtime error on test 7. I tried finding out what exactly can be the error but I couldn't get any. Most of the variables are long long so overflow can't happen and I have applied conditions to check if the indices are in bound or not but still it's giving runtime error. I am not sure what the mistake is. Please help me out in finding out the mistake.

Here is a link to my solution. Thank you.

Tags runtime error

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English I_am_Mahi 2025-02-02 09:42:38 621 Initial revision (published)