Python runtime error (NZEC)

code removed

u shall get the solutions after 10 days,till then keep trying urself…

All I can say is that I wrote the problem, and there are no errors in the test case files as you can see from the over 1250 AC answers… Including Python and Python 3…