Help me in solving LB02B problem

My issue

I AM not getting about this logic problem pls any one explain me

Learning course: Solve Programming problems using Python
Problem Link: CodeChef: Practical coding for everyone