What is wrong in this code and what does it mean by the statement that first line is the input of no of testcases

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

int main(){

int n;
cin>>n;
int a[1000];
int maxsum=0;
int sum;
for(int q=0;q<n;q++){
    cin>>a[q];
}
for(int i=0;i<n;i++){
   
    for(int j=i;j<n;j++){
     sum=0;

for(int k=i;k<=j;k++){
sum=sum+a[k];
}
if(sum>maxsum){
maxsum=sum;
}

    }
   
}
 cout<<maxsum;

}

hi @shivamm2110 make array size bigger a[100000]; and print new line in each test case