#include
using namespace std;
void subArray(signed long int a[], int n){
int left=-1, right=-1;
int maxSum=0;
int currentSum=0;
static int t=1;
cout<<"for test case "<<t<<endl;
for(int i=0; i<n; i++){
currentSum+=a[i];
if(currentSum<0){
currentSum=0;
}
maxSum=max(maxSum, currentSum);
cout<<maxSum;
}
cout<<" maximum sub array sum = "<<maxSum;
for(int i=left; i<right; i++){
cout<<a[i];
}
}
int main()
{ int nTC;
cout<<" number of testcases :";
cin>>nTC;
cout<<endl;
for(int i=0; i<nTC; i++){
cout<<"number of elements in array "<<i<<": ";
int n;
cin>>n;
signed long int a[n];
for(int i=0; i<n; i++){
cin>>a[i];
}
subArray(a, n);
}
return 0;
}