I'm getting NZEC error even if I used correct input methods

I have solved this problem but I’m not getting what’s wrong in the code

NODRUGS

I got NZEC error even I used map(int,input().split()) method.
Can someone please help me with this ? I have also tried to cover code in try and catch block it gives me WA (wrong answer) I want to know where I went wrong ?
This is another submission with try and catch block:-
https://www.codechef.com/viewsolution/50508258

Cover your code inside a try catch block and check if it works.

I have also tried it Solution: 50508258 | CodeChef
It gives wrong answer but I’m not getting where I’m gone wrong

that max(lis[0:n-1])

what will happen if n=1.

2 Likes

ohh Thanks a lot for your help.