Help me in solving CONQUEROR problem

My issue

not able to solve please help

My code

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

int main() {
	// your code goes here

}

Problem Link: Trial of the Conqueror Practice Coding Problem - CodeChef

I want to undertant like how to think of approach