for this particular problem
https://hack.codingblocks.com/contests/c/474/64
i cant figure out what are the cases which are giving wrong answer
here are are my seemingly correct solutions
http://ide.codingblocks.com/#/s/13974
http://ide.codingblocks.com/#/s/13975