Help me in solving LB03B problem

My issue

Learning course: C++ for problem solving - 1
Problem Link: CodeChef: Practical coding for everyone