Help me in solving LBC08A problem

My issue

What is the logic

My code

// Step 1: Read and understand the problem statement and sample test cases

// Click on Next once you are ready to proceed.

Learning course: Solve Programming problems using C++
Problem Link: Problem (Shoes) - Read the problem statement Practice Problem in Solve Programming problems using C++ - CodeChef