https://hack.codingblocks.com/contests/c/509/220 my code-https://ide.codingblocks.com/#/s/31064 2nd test case is wrong.
https://ide.codingblocks.com/#/s/31073
i have made the changes and commented it.