Help me in solving SLOWSOLN problem

My issue

actually I dont understand the question how the inputs are working can you explain me briefly

My code

#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here

}

Problem Link: Slow Solution Practice Coding Problem - CodeChef

@indukavida
this problem is quite typical to understand.
plzz refer the following solution and dry run on several smaller test cases to get better intuition.
https://www.codechef.com/viewsolution/82652681