#include
#include
#include
using namespace std;
int main() {
long long int cursum=0;
long long int arr[100000];
long long int maxsum = 0;
long long int m,n;
cin>>m;
while(m–){
cin>>n;
for(int i=0;i<n;i++){
cin>>arr[i];
}
for(int i=0;i<n;i++){
cursum = cursum + arr[i];
if(cursum < 0){
cursum = 0;
}
maxsum = max(cursum,maxsum);
}
cout<<maxsum<<endl;
}
return 0;
}
i am getting wrong answers in all the testcases .pls tell the correct code