Help me in solving TIME08 problem

My issue

dont know how to tackle this

Learning course: BCS301: Data structures
Problem Link: https://www.codechef.com/learn/course/abesit-dsa/ABESITDS02/problems/TIME08