Reagrding this program

sir this a hackerblock problem
https://hack.codingblocks.com/app/practice/3/70/problem
and my output is not right can you help me with this