ARRAY - Circular Sum

Can you tell me whats wrong in this for circular sum of array as it is compiling successfully but showing “wrong annswer” after submission.

#include
using namespace std;

int main(){
int t,n,a[10000];
cin>>t;
int r=0;
label :
r++;
cin>>n;
for(int i=0;i<n;i++){
cin>>a[i];
}
int cs=0, ms=0;
for(int i=0;i<n;i++){
cs=cs+a[i];
if(cs<0){
cs=cs-a[i];
}
ms=max(cs,ms);
} cout<<ms<<endl;
if(r<t){
goto label;
}
return 0;
}

you need to find maximum sum in a circular array but you are finding maximum sum subarray in a linear array. Circular array is a special array in which the last element is connected to the first element. so if we were given a circular subarray 1 2 3. Then we would say that 2 is present on the left of 3 and 1 is present on the right of 3.
please refer to this article for soltion:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.