What is wrong with my code?

https://ide.codingblocks.com/s/310529 Only the first test case is running

Updated ur code: