GOOGLE KICKSTART 2019 previous year question (ROUND A-TRAINING)

Can you guys point out which test case is this code failing in ?
I am not being able to figure it out . any help is appreciated

question is from ROUND A and its name is TRAINING
here’s my code:-

ideone code of mine :-