Not getting correct output

I think the code is correct and gives correct output on sample test cases and i also tried few other cases but its giving wrong answer for all test cases

hi @paidaarpit1505_f9664148aad841e0 updated https://ide.codingblocks.com/s/667323