Help me in solving BLDST problem

My issue

My code

#include <iostream>
using namespace std;

int main() {
	int t;
	cin>>t;
	while(t--)
	{
	    int n,m;
	    cin>>n>>m;
	    
	    int arr[m];
	    
	    for(int i = 0;i<m;i++)
	    {
	        cin>>arr[i];
	    }
	    
	    
	}
	return 0;
}

Problem Link: BLDST Problem - CodeChef

@udham8306
the logic is to sum up all the balls then divide them with number of boxes if it reaches the last layer then print the number of balls in the last layer .
Actually we are trying to fill the boxes vertically .