why i get wrong answere problem chefadv

i applied all test cases in my code but it is giving wrong answere
here is my code

This is an ongoing competition. The rules forbid sharing your code - and luckily for you the system also blocks it. General advice is to read the specification carefully and make up new test cases for yourself.