Doubt on the problem on cp

problwe link-https://ide.codingblocks.com/s/571443
solution link-https://ide.codingblocks.com/s/571444
Its not passing all the test cases