https://hack.codingblocks.com/contests/c/754/951
dont know why getting only half of the test cases passed??