Failing test cases

https://ide.codingblocks.com/s/344576.

My code is doing the desired operation but failing test cases. What is the reason?

print answer for each test case in a new line.