Failing test cases don't know what's wrong

Sample test case is passing and I have tried other custom inputs as well don’t know what’s wrong.
Help me.

Link to my code is https://ide.codingblocks.com/s/175965

I have edited your code… Try to submit now.