Https://www.codechef.com/viewsolution/41926576

https://www.codechef.com/viewsolution/41926576

Runtime Error
NZEC

Error
Traceback (most recent call last):
File “./prog.py”, line 1, in
EOFError: EOF when reading a line

I am new to CodeChef and I couldn’t understand where the error is.

Your logic was incorrect. I have corrected the logic and it gets accepted.
https://www.codechef.com/viewsolution/41927043