Why are test cases failing

https://ide.codingblocks.com/s/331744 what i have done is maintained count of a and b Then compared there count and then compared difference of there count and the no. of moves which are provided in input and acc. to that i have multiplied the min. of moves with 2 and then output