Please help me in debugging my code

Please tell me what is wrong in my code. It is giving WA on multiple test cases

Link: https://ide.codingblocks.com/s/246813

Now its working https://ide.codingblocks.com/s/250675