Help me in solving KIND problem

My issue

I am not able to start thinking any approach for this problem,where should I start from?

My code

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

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--)
	{
	    
	}
	return 0;
}

Problem Link: Array Operations Practice Coding Problem - CodeChef