For this Question: Given an array arr[] of N integers arranged in a circular fashion. Your task is to find the maximum contiguous subarray sum containing at least 1 element.The first line of input contains a single integer T which denotes the number of test cases. The first line of each test case contains a single integer N which denotes the total number of elements. The second line of each test case contains N space-separated integers denoting the elements of the array.

<b>Constraints:</b>
1 <= T <= 100
1 <= N <= 10^5
-10^6 <= Arr[i] <= 10^6

The Sum of N over all test cases is less than equal to 10^6.For each test case print the maximum sum obtained by adding the consecutive elements.<b>Input:</b>
4
7
8 -8 9 -9 10 -11 12
8
10 -3 -4 7 6 5 -4 -1
8
-1 40 -14 7 6 5 -4 -1
4
-1 -2 -3 -4

<b>Output:</b>
22
23
52
-1

Explanation:
Testcase 1: Starting from the last element of the array, i.e, 12, and moving in a circular fashion, we have max subarray as 12, 8, -8, 9, -9, 10, which gives the maximum sum as 22., I have written this Solution Code: 
#include <bits/stdc++.h>


using namespace std;

#define MEM(a, b) memset(a, (b), sizeof(a))

#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)

#define IN(A, B, C) assert( B <= A && A <= C)

#define MP make_pair
#define FOR(i,a) for(int i=0;i<a;i++)

#define FOR1(i,j,a) for(int i=j;i<a;i++)

#define EB emplace_back


#define EPS 1e-9

#define PI 3.1415926535897932384626433832795
#define max1 10001
#define MOD 1000000007

#define read(type) readInt<type>()

#define out(x) cout<<x<<'\n'
#define out1(x) cout<<x<<" "
#define END cout<<'\n'
#define int long long
void fast(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
int INF = 4557430888798830399ll;
signed  main()
{
fast();
    int t;
    cin>>t;
    while(t--){
    int n;
    cin>>n;

    vector<int> A(n);
    FOR(i,n){
    cin>>A[i];
    }
		int maxTillNow = -INF;
        int maxEndingHere = -INF;
		int  start = 0;
		while (start < A.size()) {
			maxEndingHere = max(maxEndingHere + A[start], (int)A[start]);
			maxTillNow = max(maxTillNow, maxEndingHere);
			start++;
		}

		
	
		vector<int> prefix(n, 0), suffix(n, 0), maxSuffTill(n, 0);
		for (int i = 0; i < n; ++i) {
			prefix[i] = A[i];
			if (i != 0) prefix[i] += prefix[i - 1];
		}

		for (int i = n - 1; i >= 0; --i) {
			suffix[i] = A[i];
			maxSuffTill[i] = max(A[i],(int) 0);
			if (i != n - 1) {
				suffix[i] += suffix[i + 1];
				maxSuffTill[i] = max(suffix[i], maxSuffTill[i + 1]);
			}
		}

		for (int i = 0; i < n; ++i) {
			int sum = prefix[i];
			if (i != n - 1) sum += maxSuffTill[i + 1];
			maxTillNow = max(maxTillNow, sum);
		}

		out(maxTillNow);


}}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?