WA in MFSS in June Challenge

The question is this:CodeChef: Practical coding for everyone
My solution is this:CodeChef: Practical coding for everyone

Someone pls help identify why i am getting WA in this,I tried a lot but although i tried with the test data+ i tried corner cases,yet it still continued giving me WA.

Will appreciate if someone helps me out with this. :slight_smile: