  #include <iostream>
    #include <bits/stdc++.h>
    #include <math.h>
    using namespace std;
    #define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    #include <ext/pb_ds/assoc_container.hpp>
    #include <ext/pb_ds/tree_policy.hpp>

    #define ull unsigned long long
    #define int long long
    #define pb push_back
    #define SZ(x) ((int)x.size())
    #define mp make_pair
    #define ff first
    #define ss second
    #define lb lower_bound
    #define ub upper_bound
    #define endl "\n"
    #define Max(x,y,z) max(x,max(y,z))
    #define Min(x,y,z) min(x,min(y,z))
    #define MAX 1e18
    #define PI 3.14159265
    const int mod = 1e9 + 7;

    #define ordered_set tree<pair<int, int>, null_type,less<pair<int, int>>, rb_tree_tag,tree_order_statistics_node_update>

    int power(int x, int y)
    {
       int res = 1;

        while (y > 0)
        {

            if (y & 1)
                res = (long long)(res*x);

            y = y>>1;

            if (x<=100000000)
            x = (long long)(x*x);

            //cout<<x<<'\n';
        }
        return res;
    }

    int gcd (int a, int b) {
        if (b == 0)
            return a;
        else
            return gcd (b, a % b);
    }

    int ceiling(int a,int b){
      if(a%b!=0){
        return (a/b)+1;

      }
      else
        return (a/b);
    }

    int lcm (int a, int b) {
        return a / gcd(a, b) * b;
    }

    bool isPrime(int n)
    {
        // Corner cases
        if (n <= 1)
            return false;
        if (n <= 3)
            return true;

        // This is checked so that we can skip
        // middle five numbers in below loop
        if (n % 2 == 0 || n % 3 == 0)
            return false;

        for (int i = 5; i * i <= n; i = i + 6)
            if (n % i == 0 || n % (i + 2) == 0)
                return false;

        return true;
    }

void solve()
{
  int n;
  cin>>n;
  int c[n];
  for(int i=0;i<n;i++){
    cin>>c[i];
  }

  if(n==1){
    cout<<1<<" "<<c[0]<<" "<<0<<endl;
    return;
  }
  //ok boomer

  int a=0;
  int b=0;
  int l=0;
  int r=n-1;
  int moves=0;

  a+=c[0];
  l++;
  int prev=c[0];
  moves++;

  while(l<=r)
  {
    if(c[r]>prev and moves%2!=0){

      b+=c[r];
      prev=c[r];
      r--;

    }
    else if(c[r]<=prev and moves%2!=0){
      int k=0;

      while(k<=prev and l<=r){
        k+=c[r];
        r--;

      }

      b+=k;
      prev=k;
    }

    else if(c[l]>prev and moves%2==0){
      a+=c[l];
      prev=c[l];
      l++;

    }

    else if(c[l]<=prev and moves%2==0){
      int j=0;

      while(j<=prev and l<=r){
        j+=c[l];
        l++;
      }

      a+=j;
      prev=j;
    }
    moves++;

  }

    cout<<moves<<" "<<a<<" "<<b<<endl;

  return;
}

 int32_t main()

{
   IOS;

   int t;
   cin>>t;
   while(t--){
    solve();
   }

   return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int a;
        cin>>a;
        int arr[a];
        for(int i=0; i<a; i++)
            cin>>arr[i];

        int alice=0,bob=0,moves=0;
        int suma=0,sumb=0;
        int i=0,j=a-1;
        while(i<=j)
        {
            if(moves%2==0)
            {
                int fsum=0;
                while(i<=j&&fsum<=sumb)
                {
                    fsum+=arr[i];
                    i++;
                }
                alice+=fsum;
                suma+=fsum;
            }
            else
            {
                int fsumb=0;
                while(i<=j&&fsumb<=suma)
                {
                    fsumb+=arr[j];
                    j--;
                }
                bob+=fsumb;
                sumb=fsumb;
            }
            moves++;
        }cout<<moves<<" "<<alice<<" "<<bob<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int a;
        cin>>a;
        int arr[a];
        for(int i=0;i<a;i++)
            cin>>arr[i];
        int alice=0,bob=0,moves=0;
        int suma=0,sumb=0;
        int i=0,j=a-1;
        while(i<=j)
        {
            if(moves%2==0)
            {
               int fsuma=0;
               while(i<=j&&fsuma<=sumb)
               {
                   fsuma+=arr[i];
                   i++;
               }
               alice+=fsuma;
               suma=fsuma;
            }
            else
            {
                int fsumb=0;
                while(i<=j&&fsumb<=suma)
                {
                    fsumb+=arr[j];
                    j--;
                }
                bob+=fsumb;
                sumb=fsumb;
            }
            moves++;
        }
        cout<<moves<<" "<<alice<<" "<<bob<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int a;
        cin>>a;
        int arr[a];
        for(int i=0; i<a; i++)
            cin>>arr[i];

        int alice=0,bob=0,moves=0;
        int suma=0,sumb=0;
        int i=0,j=a-1;
        while(i<=j)
        {
            if(moves%2==0)
            {
                int fsum=0;
                while(i<=j&&fsum<=sumb)
                {
                    fsum+=arr[i];
                    i++;
                }
                alice+=fsum;
                suma+=fsum;
            }
            else
            {
                int fsumb=0;
                while(i<=j&&fsumb<=suma)
                {
                    fsumb+=arr[j];
                    j--;
                }
                bob+=fsumb;
                sumb+=fsumb;
            }
            moves++;
        }cout<<moves<<" "<<alice<<" "<<bob<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int a;
        cin>>a;
        int arr[a];
        for(int i=0; i<a; i++)
            cin>>arr[i];

        int alice=0,bob=0,moves=0;
        int suml=0,sumr=0;
        int c=0;
        int i=0,j=a-1;
        while(i<=j)
        {
            if(c%2==0)
            {
               int nsuml=0;
                while(nsuml<=sumr && i<=j)
                {
                    nsuml+=arr[i];
                    i++;
                }
                alice+=nsuml;
                suml=nsuml;
            }
            else
            {
                 int nsumr=0;

                while(nsumr<=suml && i<=j)
                {
                    nsumr+=arr[j];
                    j--;
                }
                bob+=nsumr;
                sumr=nsumr;

            }
            c++;
        }
        cout<<c<<" "<<alice<<" "<<bob<<endl;
    }

}


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

typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;

typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;

#define forn(i,n) for(int i=0;i<n;i++)
#define rforn(i,n) for(int i=n-1;i>=0;i--)
#define forne(i,n) for(int i=1;i<=n;i++)
#define forse(i,s,e) for(int i=s;i<e;i++)
#define rforse(i,s,e) for(int i=e-1;i>=s;i--)

#define F first
#define S second
#define pb push_back
#define all(x) x.begin(),x.end()

ll zero = 0;
ll one = 1;
ll MAX_SIZE_5 = 100005;
ll MAX_SIZE_6 = 1000005;
ll max_ll = LLONG_MAX;
ll min_ll = LLONG_MIN;
int max_int = INT_MAX;
int min_int = INT_MIN;
ll mod = 1000000007;

// ------------------------------------------------------------------------------------------------------------------
ll my_pow(ll a, ll b, ll m = mod){                         // computes (a^b)%m;
	if(b == 1){ return a%m;}

	ll temp = my_pow(a, b/2);
	if(b%2 == 0){ return (temp*temp)%m;
	}else{ return (((temp*temp)%m)*a)%m;}
}

ll mod_inv(ll x, ll m = mod){                                 // computes mod_inverse of x w.r.to m (x^m-2)
	return my_pow(x, m-2, m);
}
// -------------------------------------------------------------------------------------------------------------------

void solve(){
	ll n;
	cin>>n;

	vl a(n);
	forn(i,n) cin>> a[i];

	ll alice_sum = 0;
	ll bob_sum = 0;
	ll moves = 0;

	ll alice = 0;
	ll bob = n-1;

	alice = 1;
	moves = 1;
	alice_sum = a[0];
	ll state = a[0];
	ll chance = 1;
	bool possible = true;

	while(possible){

		if(chance == 1){
			// Bob's turn
			ll temp = 0;
			while(bob >= alice){
				temp += a[bob];
				bob_sum += a[bob];
				bob--;

				if(temp > state){
					break;
				}
			}

			state = temp;
			chance = 0;
			moves++;

			if(bob < alice){
				possible = false;
			}
		}else{
			ll temp = 0;
			while(alice <= bob){
				temp += a[alice];
				alice_sum += a[alice];
				alice++;

				if(temp > state){
					break;
				}
			}

			state = temp;
			chance = 1;
			moves++;

			if(alice > bob){
				possible = false;
			}
		}
	}

	cout<<moves<<" "<<alice_sum<<" "<<bob_sum<<"\n";
}

int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	cout.tie(NULL);

	int t = 1;
	cin>>t;
	while(t--){
		solve();
	}
	return 0;
}


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

typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;

typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;

#define forn(i,n) for(int i=0;i<n;i++)
#define rforn(i,n) for(int i=n-1;i>=0;i--)
#define forne(i,n) for(int i=1;i<=n;i++)
#define forse(i,s,e) for(int i=s;i<e;i++)
#define rforse(i,s,e) for(int i=e-1;i>=s;i--)

#define F first
#define S second
#define pb push_back
#define all(x) x.begin(),x.end()

ll zero = 0;
ll one = 1;
ll MAX_SIZE_5 = 100005;
ll MAX_SIZE_6 = 1000005;
ll max_ll = LLONG_MAX;
ll min_ll = LLONG_MIN;
int max_int = INT_MAX;
int min_int = INT_MIN;
ll mod = 1000000007;

// ------------------------------------------------------------------------------------------------------------------
ll my_pow(ll a, ll b, ll m = mod){                         // computes (a^b)%m;
	if(b == 1){ return a%m;}

	ll temp = my_pow(a, b/2);
	if(b%2 == 0){ return (temp*temp)%m;
	}else{ return (((temp*temp)%m)*a)%m;}
}

ll mod_inv(ll x, ll m = mod){                                 // computes mod_inverse of x w.r.to m (x^m-2)
	return my_pow(x, m-2, m);
}
// -------------------------------------------------------------------------------------------------------------------

void solve(){
	ll n;
	cin>>n;

	vl a(n);
	forn(i,n) cin>> a[i];

	ll alice_sum = 0;
	ll bob_sum = 0;
	ll moves = 0;

	ll alice = 0;
	ll bob = n-1;

	alice = 1;
	moves = 1;
	alice_sum = a[0];
	ll state = a[0];
	ll chance = 1;
	bool possible = true;

	if(bob < alice){
		possible = false;
	}

	while(possible){

		if(chance == 1){
			// Bob's turn
			ll temp = 0;
			while(bob >= alice){
				temp += a[bob];
				bob_sum += a[bob];
				bob--;

				if(temp > state){
					break;
				}
			}

			state = temp;
			chance = 0;
			moves++;

			if(bob < alice){
				possible = false;
				// moves--;
			}
		}else{
			ll temp = 0;
			while(alice <= bob){
				temp += a[alice];
				alice_sum += a[alice];
				alice++;

				if(temp > state){
					break;
				}
			}

			state = temp;
			chance = 1;
			moves++;

			if(alice > bob){
				possible = false;
				// moves--;
			}
		}
	}

	cout<<moves<<" "<<alice_sum<<" "<<bob_sum<<"\n";
	// string ans = "";
	// ans += to_string(moves);
	// ans += " ";
	// ans += to_string(alice_sum);
	// ans += " ";
	// ans += to_string(bob_sum);
	// ans += "\n";

	// cout<<ans;
}

int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	cout.tie(NULL);

	int t = 1;
	cin>>t;
	while(t--){
		solve();
	}
	return 0;
}


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

typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;

typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;

#define forn(i,n) for(int i=0;i<n;i++)
#define rforn(i,n) for(int i=n-1;i>=0;i--)
#define forne(i,n) for(int i=1;i<=n;i++)
#define forse(i,s,e) for(int i=s;i<e;i++)
#define rforse(i,s,e) for(int i=e-1;i>=s;i--)

#define F first
#define S second
#define pb push_back
#define all(x) x.begin(),x.end()

ll zero = 0;
ll one = 1;
ll MAX_SIZE_5 = 100005;
ll MAX_SIZE_6 = 1000005;
ll max_ll = LLONG_MAX;
ll min_ll = LLONG_MIN;
int max_int = INT_MAX;
int min_int = INT_MIN;
ll mod = 1000000007;

// ------------------------------------------------------------------------------------------------------------------
ll my_pow(ll a, ll b, ll m = mod){                         // computes (a^b)%m;
	if(b == 1){ return a%m;}

	ll temp = my_pow(a, b/2);
	if(b%2 == 0){ return (temp*temp)%m;
	}else{ return (((temp*temp)%m)*a)%m;}
}

ll mod_inv(ll x, ll m = mod){                                 // computes mod_inverse of x w.r.to m (x^m-2)
	return my_pow(x, m-2, m);
}
// -------------------------------------------------------------------------------------------------------------------

void solve(){
	ll n;
	cin>>n;

	vl a(n);
	forn(i,n) cin>> a[i];

	ll alice_sum = 0;
	ll bob_sum = 0;
	ll moves = 0;

	ll alice = 0;
	ll bob = n-1;

	alice = 1;
	moves = 1;
	alice_sum = a[0];
	ll state = a[0];
	ll chance = 1;
	bool possible = true;

	while(possible){

		if(chance == 1){
			// Bob's turn
			ll temp = 0;
			while(bob >= alice){
				temp += a[bob];
				bob_sum += a[bob];
				bob--;

				if(temp > state){
					break;
				}
			}

			state = temp;
			chance = 0;
			moves++;

			if(bob < alice){
				possible = false;
			}
		}else{
			ll temp = 0;
			while(alice <= bob){
				temp += a[alice];
				alice_sum += a[alice];
				alice++;

				if(temp > state){
					break;
				}
			}

			state = temp;
			chance = 1;
			moves++;

			if(alice > bob){
				possible = false;
			}
		}
	}

	cout<<moves<<" "<<alice_sum<<" "<<bob_sum<<endl;
}

int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	cout.tie(NULL);

	int t = 1;
	cin>>t;
	while(t--){
		solve();
	}
	return 0;
}


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

typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;

typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;

#define forn(i,n) for(int i=0;i<n;i++)
#define rforn(i,n) for(int i=n-1;i>=0;i--)
#define forne(i,n) for(int i=1;i<=n;i++)
#define forse(i,s,e) for(int i=s;i<e;i++)
#define rforse(i,s,e) for(int i=e-1;i>=s;i--)

#define F first
#define S second
#define pb push_back
#define all(x) x.begin(),x.end()

ll zero = 0;
ll one = 1;
ll MAX_SIZE_5 = 100005;
ll MAX_SIZE_6 = 1000005;
ll max_ll = LLONG_MAX;
ll min_ll = LLONG_MIN;
int max_int = INT_MAX;
int min_int = INT_MIN;
ll mod = 1000000007;

// ------------------------------------------------------------------------------------------------------------------
ll my_pow(ll a, ll b, ll m = mod){                         // computes (a^b)%m;
	if(b == 1){ return a%m;}

	ll temp = my_pow(a, b/2);
	if(b%2 == 0){ return (temp*temp)%m;
	}else{ return (((temp*temp)%m)*a)%m;}
}

ll mod_inv(ll x, ll m = mod){                                 // computes mod_inverse of x w.r.to m (x^m-2)
	return my_pow(x, m-2, m);
}
// -------------------------------------------------------------------------------------------------------------------

void solve(){
	ll n;
	cin>>n;

	vl a(n);
	forn(i,n) cin>> a[i];

	ll alice_sum = 0;
	ll bob_sum = 0;
	ll moves = 0;

	ll alice = 0;
	ll bob = n-1;

	alice = 1;
	moves = 1;
	alice_sum = a[0];
	ll state = a[0];
	ll chance = 1;
	bool possible = true;

	while(possible){

		if(chance == 1){
			// Bob's turn
			ll temp = 0;
			while(bob >= alice){
				temp += a[bob];
				bob_sum += a[bob];
				bob--;

				if(temp > state){
					break;
				}
			}

			state = temp;
			chance = 0;
			moves++;

			if(bob < alice){
				possible = false;
			}
		}else{
			ll temp = 0;
			while(alice <= bob){
				temp += a[alice];
				alice_sum += a[alice];
				alice++;

				if(temp > state){
					break;
				}
			}

			state = temp;
			chance = 1;
			moves++;

			if(alice > bob){
				possible = false;
			}
		}
	}

	// cout<<moves<<" "<<alice_sum<<" "<<bob_sum<<"\n";
	string ans = "";
	ans += to_string(moves);
	ans += " ";
	ans += to_string(alice_sum);
	ans += " ";
	ans += to_string(bob_sum);
	ans += "\n";

	cout<<ans;
}

int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	cout.tie(NULL);

	int t = 1;
	cin>>t;
	while(t--){
		solve();
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int i,j;
        int sum=0,summ=0,total=0;
        int count=0;
        int n;
        cin>>n;
        vector<int>v;
        for(int i=0;i<n;i++)
        {
        int a;
        cin>>a;
        v.push_back(a);
        }
        int l=0;
        int r=0;
        while(1)
        {
            total++;
            r=0;
        for(int i=0;i<v.size();i++)
        {
         //   r=0;
            r+=v[i];
            sum+=v[i];
           // cout<<v[i]<<endl;
            int u=i;
            auto it=v.begin()+u;
            v.erase(it);
            if(r>l)
            {

                break;
            }
            else if(i==v.size())
            {
                count=1;
                break;
            }
            else{
                i=-1;
            }
        }
            if(v.size()==0)
            {
                count=1;

            }
            if(v.size()!=0)
            {

         total++;
        l=0;
        for(int j=v.size()-1;j>=0;j--)
        {
           // l=0;
            l+=v[j];
            summ+=v[j];
            int vp=j;
            auto itr=v.begin()+vp;
            v.erase(itr);
            if(l>r)
            {
                break;
            }
            else if(j==0){
                count=1;
                break;;
            }
            else
            {
                j=v.size();
            }
        }
            if(v.size()==0)
            {
                count=1;

        }
            }

        if(count==1)
        {
            break;
        }
        }
        cout<<total<<" "<<sum<<" "<<summ<<endl;
       // cout<<v.size()<<endl;
    }
    return 0;

    }


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int i,j;
        int sum=0,summ=0,total=0;
        int count=0;
        int n;
        cin>>n;
        vector<int>v;
        for(int i=0;i<n;i++)
        {
        int a;
        cin>>a;
        v.push_back(a);
        }
        int l=0;
        int r=0;
        while(1)
        {
            total++;
            r=0;
        for(int i=0;i<v.size();i++)
        {
         //   r=0;
            r+=v[i];
            sum+=v[i];
           // cout<<v[i]<<endl;
            int u=i;
            auto it=v.begin()+u;
            v.erase(it);
            if(r>l)
            {

                break;
            }
            else if(i==v.size())
            {
                count=1;
                break;
            }
            else{
                i=-1;
            }
        }
            if(v.size()==0)
            {
                count=1;

            }
            if(v.size()!=0)
            {

         total++;
        l=0;
        for(int j=v.size()-1;j>=0;j--)
        {

            l+=v[j];
            summ+=v[j];
            int vp=j;
            auto itr=v.begin()+vp;
            v.erase(itr);
            if(l>r)
            {
                break;
            }
            else if(j==0){
                count=1;
                break;;
            }
            else
            {
                j=v.size();
            }
        }
            if(v.size()==0)
            {
                count=1;

        }
            }

        if(count==1)
        {
            break;
        }
        }
        cout<<total<<" "<<sum<<" "<<summ<<endl;
    }
    return 0;

    }


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int i,j;
        int sum=0,summ=0,total=0;
        int count=0;
        int n;
        cin>>n;
        vector<int>v;
        for(int i=0;i<n;i++)
        {
        int a;
        cin>>a;
        v.push_back(a);
        }
        int l=0;
        int r=0;
        while(1)
        {
            total++;
            r=0;
        for(int i=0;i<v.size();i++)
        {
         //   r=0;
            r+=v[i];
            sum+=v[i];
           // cout<<v[i]<<endl;
            int u=i;
            auto it=v.begin()+u;
            v.erase(it);
            if(r>l)
            {

                break;
            }
            else if(v.size()==0)
            {
                count=1;
                break;
            }
            else{
                i=-1;
            }
        }
            if(v.size()==0)
            {
                count=1;

            }
            if(v.size()!=0)
            {

         total++;
        l=0;
        for(int j=v.size()-1;j>=0;j--)
        {

            l+=v[j];
            summ+=v[j];
            int vp=j;
            auto itr=v.begin()+vp;
            v.erase(itr);
            if(l>r)
            {
                break;
            }
            else if(v.size()==0){
                count=1;
                break;;
            }
            else
            {
                j=v.size();
            }
        }
            if(v.size()==0)
            {
                count=1;

        }
            }

        if(count==1)
        {
            break;
        }
        }
        cout<<total<<" "<<sum<<" "<<summ<<endl;
    }
    return 0;

    }


#include<bits/stdc++.h>
using namespace std;
int main()
{

	int t;
	cin>>t;
	while(t--)
	{

		int n;
		cin>>n;
		int i=0,j=n-1,count=0,a1=0,b1=0,m=0,x,y;
		int arr[n];
		for(i=0;i<n;i++)
			cin>>arr[i];
			i=0;
		if(n==1)
		cout<<1<<" "<<arr[0]<<" "<<0<<endl;
		else
		{
		while(i<j)
		{
			int l=0,r=0;
			for(x=i;x<n;x++)
			{
				if(i>j)
				break;
				a1=a1+arr[i];
				l=l+arr[i];
				i++;
				if(l>m)
				{
					m=l;
					break;
				}
			}
			count++;
			for(y=j;y>=0;y--)
			{
				if(i>j)
				break;
				b1=b1+arr[j];
				r=r+arr[j];
				j--;
				if(r>m)
				{
					m=r;
					break;
				}
			}
			count++;

		}

		cout<<count<<" "<<a1<<" "<<b1<<endl;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{

	int t;
	cin>>t;
	while(t--)
	{

		int n;
		cin>>n;
		int i=0,j=n-1,count=0,a1=0,b1=0,m=0,x,y;
		int arr[n];
		for(i=0;i<n;i++)
			cin>>arr[i];
			i=0;
		if(n==1)
		cout<<1<<" "<<arr[0]<<" "<<0<<endl;
		else
		{
		while(i<=j)
		{
			int l=0,r=0;
			for(x=i;x<n;x++)
			{
				if(i>j)
				break;
				a1=a1+arr[i];
				l=l+arr[i];
				i++;
				if(l>m)
				{
					m=l;
					break;
				}
			}
			count++;
			for(y=j;y>=0;y--)
			{
				if(i>j)
				break;
				b1=b1+arr[j];
				r=r+arr[j];
				j--;
				if(r>m)
				{
					m=r;
					break;
				}
			}
			count++;

		}

		cout<<count<<" "<<a1<<" "<<b1<<endl;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{

	int t;
	cin>>t;
	while(t--)
	{

		int n;
		cin>>n;
		int i=0,j=n-1,count=0,a1=0,b1=0,m=0,x,y;
		int arr[n];
		for(i=0;i<n;i++)
			cin>>arr[i];
			i=0;
		if(n==1)
		cout<<1<<" "<<arr[0]<<" "<<0<<endl;
		else
		{
		while(i<j)
		{
			int l=0,r=0;
			if(i<=j)
			count++;
			for(x=i;x<n;x++)
			{
				if(i>j)
				break;
				a1=a1+arr[i];
				l=l+arr[i];
				i++;
				if(l>m)
				{
					m=l;
					break;
				}
			}
			if(i<=j)
			count++;
			for(y=j;y>=0;y--)
			{
				if(i>j)
				break;
				b1=b1+arr[j];
				r=r+arr[j];
				j--;
				if(r>m)
				{
					m=r;
					break;
				}
			}

		}

		cout<<count<<" "<<a1<<" "<<b1<<endl;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{

	int t;
	cin>>t;
	while(t--)
	{

		int n;
		cin>>n;
		int i=0,j=n-1,count=0,a1=0,b1=0,m=0,x,y;
		int arr[n];
		for(i=0;i<n;i++)
			cin>>arr[i];
			i=0;
		if(n==1)
		cout<<1<<" "<<arr[0]<<" "<<0<<endl;
		else
		{
		while(i<=j)
		{
			int l=0,r=0;
			if(i<=j)
			count++;
			for(x=i;x<n;x++)
			{
				if(i>j)
				break;
				a1=a1+arr[i];
				l=l+arr[i];
				i++;
				if(l>m)
				{
					m=l;
					break;
				}
			}
			if(i<=j)
			count++;
			for(y=j;y>=0;y--)
			{
				if(i>j)
				break;
				b1=b1+arr[j];
				r=r+arr[j];
				j--;
				if(r>m)
				{
					m=r;
					break;
				}
			}

		}

		cout<<count<<" "<<a1<<" "<<b1<<endl;
		}
	}
	return 0;
}


#include <iostream>

using namespace std;

void solve()
{
	int n, upper, times = 1;
	cin >> n;
	upper = n-1;
	int a[n];
	for(int i =0; i < n; i++)
		cin >> a[i];
	int al = a[0], bob = 0, last = a[0], now;
	for(int i = 1; i <= upper;)
	{
		now = 0;
		while(now < last && upper >= i)
		{
			now += a[upper];
			upper--;
		}
		times++;
		bob += now;
		last = now;
		now = 0;
		while(now < last && i <= upper)
		{
			now += a[i];
			i++;
		}
		if(now != 0)
			times++;
		al += now;
	}
	cout << times << ' ' << al << ' ' << bob << endl;
}

int main()
{
	ios::sync_with_stdio(false);
	int t;
	cin >> t;
	for(; t > 0; t--)
		solve();
}


#include <iostream>

using namespace std;

void solve()
{
	int n, upper, times = 1;
	cin >> n;
	upper = n-1;
	int a[n];
	for(int i =0; i < n; i++)
		cin >> a[i];
	int al = a[0], bob = 0, last = a[0], now;
	for(int i = 1; i <= upper;)
	{
		now = 0;
		while(now <= last && upper >= i)
		{
			now += a[upper];
			upper--;
		}
		times++;
		bob += now;
		last = now;
		now = 0;
		while(now <= last && i <= upper)
		{
			now += a[i];
			i++;
		}
		if(now != 0)
			times++;
		al += now;
	}
	cout << times << ' ' << al << ' ' << bob << endl;
}

int main()
{
	ios::sync_with_stdio(false);
	int t;
	cin >> t;
	for(; t > 0; t--)
		solve();
}


#include <iostream>

using namespace std;

int arr[1000];

void solve()
{
	int n;
	cin >> n;
	for(int i =0 ; i< n;i++)
		cin >> arr[i];
	int upper = n-1, lower = 1, i = 1;
	int alice = arr[0], bob = 0;
	int now, last = arr[0];
	while(upper >= lower)
	{
		now = 0;
		while(now <= last && upper >= lower)
		{
			now += arr[upper];
			upper--;
		}
		if(now != 0) i++;
		bob += now;
		last = now;
		now = 0;
		while(now <= last && upper >= lower)
		{
			now += arr[lower];
			lower++;
		}
		if(now != 0) i++;
		alice += now;
		last = now;
	}
	cout << i << ' ' << alice << ' ' << bob << endl;
}

int main()
{
	ios::sync_with_stdio(false);
	int t;
	cin >> t;
	for(; t> 0; t--)
		solve();
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int t;
	cin >> t;
	while (t--)
	{
		int n;
		cin >> n;
		vector<int> a(n);
		for (auto it : a)
		{
			cin >> it;
		}
		int l = 0, r = n - 1;
		int suml = 0, sumr = 0;
		int cnt = 0, ansl = 0, ansr = 0;
		while (l <= r) {
			if (cnt % 2 == 0)
			{
				int nsuml = 0;
				while (l <= r && nsuml <= sumr)
				{
					nsuml += a[l++];
				}
				ansl += nsuml;
				suml = nsuml;
			}
			else
			{
				int nsumr = 0;
				while (l <= r && nsumr <= suml)
				{
					nsumr += a[r--];
				}
				ansr += nsumr;
				sumr = nsumr;
			}
			++cnt;
		}
		cout << cnt << " " << ansl << " " << ansr << endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int t;
	cin >> t;
	while (t--)
	{
		int n;
		cin >> n;
		vector<int> a(n);
		for (auto &it : a)
		{
			cin >> it;
		}
		int l = 0, r = n - 1;
		int suml = 0, sumr = 0;
		int cnt = 0, ansl = 0, ansr = 0;
		while (l <= r) {
			if (cnt % 2 == 0)
			{
				int nsuml = 0;
				while (l <= r && nsuml <= sumr)
				{
					nsuml += a[l++];
				}
				ansl += nsuml;
				suml = nsuml;
			}
			else
			{
				int nsumr = 0;
				while (l <= r && nsumr <= suml)
				{
					nsumr += a[r--];
				}
				ansr += nsumr;
				sumr = nsumr;
			}
			++cnt;
		}
		cout << cnt << " " << ansl << " " << ansr << endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int t;
	cin >> t;
	while (t--)
	{
		int n;
		cin >> n;
		vector<int> a(n);
		for (int i = 0; i< n; i++)
		{
			cin >> a[i];
		}
		int l = 0, r = a.size() - 1;
		int c1 = 0, c2 = 0, c = 0,s1=0,s2=0;
		while (l != r)
		{
			if (c % 2 == 0)
			{
				int ns1 = 0;
				while (l <= r && ns1 <= s2)
				{
					ns1 = ns1 + a[l];
					l++;
				}
				c1 = c1 + ns1;
				s1 = ns1;
			}
			else
			{
				int ns2 = 0;
				while (l <= r && ns2 <= s1)
				{
					ns2 = ns2 + a[r];
					l++;
				}
				c2 = c2 + ns2;
				s2 = ns2;
			}
			c++;
		}
		cout << c << " " << c1 << " " << c2 << endl;
	}
	return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define For(i,n) for(int i=0;i<n;i++)
#define mem(a,b) memset(a,b,sizeof(a))
#define int long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define ld long double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
int pp;
int32_t main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int t;
	cin >> t;
	while (t--)
	{
		int n, k = 1;
		cin >> n;
		int a = 0, b = 0, a1 = 0, b1 = 0;
		vector<int> v(n);
		for (int i = 0; i < n; i++)cin >> v[i];
		int i = 1;
		n--;
		a1 = v[0];
		a += a1;
		while (1)
		{

			b1 = 0;
			while (b1 <= a1 && n >= i)
			{
				b1 += v[n];
				n--;
			}
			//cout<<b1<<endl;
			k++;
			b += b1;
			if (n < i)break;
			a1 = 0;

			while (a1 <= b1 && i <= n)
			{
				a1 += v[i];
				i++;

			}
			//cout<<a1<<endl;
			a += a1;
			k++;
			if (i > n)break;
		}
		if (b == 0)k--;
		cout << k << " " << a << " " << b << endl;
	}
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define For(i,n) for(int i=0;i<n;i++)
#define mem(a,b) memset(a,b,sizeof(a))
#define int long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define ld long double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
int pp;
int32_t main()
{
  #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
  int t;
  cin>>t;
  while(t--)
  {
    int n,k=1;
    cin>>n;
    int a=0,b=0,a1=0,b1=0;
    vector<int> v(n);
    for(int i=0;i<n;i++)cin>>v[i];
      int i=1;
    n--;
     a1=v[0];
     a+=a1;
      while(1)
      {

          b1=0;
        while(b1<=a1&&n>=i)
        {
            b1+=v[n];
            n--;
        }
        //cout<<b1<<endl;
        k++;
       b+=b1;
        if(n<i)break;
       a1=0;
       while(a1<=b1&&i<=n)
        {
            a1+=v[i];
            i++;

        }
        //cout<<a1<<endl;
        a+=a1;
        k++;
         if(i>n)break;
      }
      cout<<k<<" "<<a<<" "<<b<<endl;
  }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define For(i,n) for(int i=0;i<n;i++)
#define mem(a,b) memset(a,b,sizeof(a))
#define int long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define ld long double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define MAXN 1000000
int32_t main()
{
  #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
  int t;
  cin>>t;
  while(t--)
  {
    int n,k=1;
    cin>>n;
    int a=0,b=0,a1=0,b1=0;
    vector<int> v(n);
    for(int i=0;i<n;i++)cin>>v[i];
      int i=1;
    n--;
     a1=v[0];
     a+=a1;
      while(1)
      {

          b1=0;
        while(b1<=a1&&n>=i)
        {
            b1+=v[n];
            n--;
        }
        //cout<<b1<<endl;
        k++;
       b+=b1;
        if(n<i)break;
       a1=0;
       while(a1<=b1&&i<=n)
        {
            a1+=v[i];
            i++;

        }
        //cout<<a1<<endl;
        a+=a1;
        k++;
         if(i>n)break;
      }
      cout<<k<<" "<<a<<" "<<b<<endl;
  }
}


#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
#define endl "\n"
#define rep(i,a,b) for(ll i=a ; i<b ; i++)
#define rep1(i,a,b) for(ll i=a ; i<=b ; i++)

using namespace std;

int main ()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	ll t ;
	cin>>t;
	while(t--)
	{
		ll n ;
		cin>>n;
		deque<ll> d;
		ll sum=0;
		rep(i,0,n) {ll x ; cin>>x ;sum+=x; d.pb(x);}
		ll moves=0;
		ll suma=0;
		ll checka=0;
		ll checkb=0;
		ll i=0;
		while(d.size()!=0)
		{
			checka=0;
			if(d.size()==0)break;
			while(checka<=checkb && d.size()!=0)
			{
				ll z=d.front();d.pop_front();checka+=z;
			}
			suma+=checka;moves++;
			checkb=0;
			if(d.size()==0)break;
			while(checkb<=checka && d.size()!=0)
			{
				ll y=d.back();
				d.pop_back();
				checkb+=y;
			}
			moves++;
		}
		cout<<moves<<" "<<suma<<" "<<sum-suma<<endl;
	}
}


#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
#define endl "\n"
#define rep(i,a,b) for(ll i=a ; i<b ; i++)
#define rep1(i,a,b) for(ll i=a ; i<=b ; i++)

using namespace std;

int main ()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	ll t ;
	cin>>t;
	while(t--)
	{
		ll n ;
		cin>>n;
		deque<ll> d;
		ll sum=0;
		rep(i,0,n) {ll x ; cin>>x ;sum+=x; d.pb(x);}
		ll moves=0;
		ll suma=0;
		ll checka=0;
		ll checkb=0;
		ll i=0;
		while(d.size()!=0)
		{
			if(i==0) {suma+=d.front();d.pop_front();checka=suma;i++;moves++;}
			else
			{
				checka=0;
				if(d.size()==0)break;
				while(checka<=checkb && d.size()!=0)
				{
					ll z=d.front();d.pop_front();checka+=z;
				}
				suma+=checka;moves++;
			}
			checkb=0;
			if(d.size()==0)break;
			while(checkb<=checka && d.size()!=0)
			{
				ll y=d.back();
				d.pop_back();
				checkb+=y;
			}
			moves++;
		}
		cout<<moves<<" "<<suma<<" "<<sum-suma<<endl;
	}
}


#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
#define endl "\n"
#define rep(i,a,b) for(ll i=a ; i<b ; i++)
#define rep1(i,a,b) for(ll i=a ; i<=b ; i++)

using namespace std;

int main ()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	ll t ;
	cin>>t;
	while(t--)
	{
		ll n ;
		cin >> n ;
		std::vector<ll> arr;
		arr.resize(n);
		ll sum=0;
		rep(i,0,n){cin>>arr[i];sum+=arr[i];}
		auto it2=arr.end();
		it2--;
		auto it1=arr.begin();
		ll z=0;
		ll sum1=0;
		ll sum2=0;
		ll total=0;
		ll counter=0;
		ll fuck=0;
		while(1)
		{
			if(it2==it1) {fuck=1;break;}
			sum1=0;
			if(z==0) {sum1+=*it1;it1++;z++;counter++;}
			else
			{
				sum1+=*it1;
				while(sum1<=sum2)
				{
					it1++;
					if(it2==it1)
					 {
					 	break;
					 }
					sum1+=*it1;
				}
				it1++;
				counter++;
				if(it1==it2) fuck=1;
			}
			total+=sum1;
			if(fuck==1) break;
			sum2=0;
			for(it2 ; it2!= arr.begin() ; it2--)
			{
				if(it2==it1){counter++;break;}
				sum2+=*it2;
				if(sum2>sum1){counter++;break;}
				else continue;
			}
		}
		if(n==1) cout<<"1  "<<arr[0]<<" 0"<<endl;
		else cout<<counter<<" "<<total<<" "<<sum-total<<endl;
		}
}


#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
#define endl "\n"
#define rep(i,a,b) for(ll i=a ; i<b ; i++)
#define rep1(i,a,b) for(ll i=a ; i<=b ; i++)

using namespace std;

int main ()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	ll t ;
	cin>>t;
	while(t--)
	{
		ll n ;
		cin >> n ;
		std::vector<ll> arr;
		arr.resize(n);
		ll sum=0;
		rep(i,0,n){cin>>arr[i];sum+=arr[i];}
		auto it2=arr.end();
		it2--;
		auto it1=arr.begin();
		ll z=0;
		ll sum1=0;
		ll sum2=0;
		ll total=0;
		ll counter=0;
		ll fuck=0;
		while(1)
		{
			if(it2==it1) {fuck=1;break;}
			sum1=0;
			if(z==0) {sum1+=*it1;it1++;z++;counter++;}
			else
			{
				sum1+=*it1;
				while(sum1<=sum2 && it1!=it2)
				{
					it1++;
					if(it2==it1)
					 {
					 	break;
					 }
					sum1+=*it1;
				}
				it1++;
				counter++;
				if(it1==it2) fuck=1;
			}
			total+=sum1;
			if(fuck==1) break;
			sum2=0;
			for(it2 ; it2!= arr.begin() ; it2--)
			{
				if(it2==it1){counter++;break;}
				sum2+=*it2;
				if(sum2>sum1){counter++;break;}
				else continue;
			}
		}
		if(n==1)cout<<"1 "<<arr[0]<<" 0"<<endl;
		else cout<<counter<<" "<<total<<" "<<sum-total<<endl;
		}
}


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

int main(){
    int t;
    cin>>t;
    while(t--){

        int n;
        cin>>n;

        vector<int> v;

        for(int i = 0;i < n;i++){
        	int t;
        	cin>>t;
        	v.push_back(t);
        }

        int turn = 1;
        int sum1 = 0,sum2 = 0;
        int total1 = 0,total2 = 0;
        int i = 0,j = n-1;

        if(n == 1){
            total1 = v[0];
            total2 = 0;
            turn = 2;
        }

        while(i < j){

        	if(turn%2 == 1){

        		while(sum1 <= sum2 && i <= j){
        			sum1 += v[i];
        			total1 += v[i];
        			i++;
        		}
                turn++;
        		sum2 = 0;
        	}else{

        		while(sum2 <= sum1 && i <= j){
        			sum2 += v[j];
        			total2 += v[j];
        			j--;

        		}
                turn++;
        		sum1 = 0;
        	}

        }

    if(i == j){
        turn++;
        total2 += v[j];
    }

	cout<<turn-1<<" "<<total1<<" "<<total2<<endl;

    }
}


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

int main(){
    int t;
    cin>>t;
    while(t--){

        int n;
        cin>>n;

        vector<int> v;

        for(int i = 0;i < n;i++){
        	int t;
        	cin>>t;
        	v.push_back(t);
        }

        int turn = 1;
        int sum1 = 0,sum2 = 0;
        int total1 = 0,total2 = 0;
        int i = 0,j = n-1;

        while(i <= j){

        	if(turn%2 == 1){
                int nsum1 = 0;

        		while(nsum1 <= sum2 && i <= j){
        			nsum1 += v[i];
        			i++;
        		}
                total1 += nsum1;
                sum1 = nsum1;
                turn++;
        	}else{

                int nsum2 = 0;
        		while(nsum2 <= sum1 && i <= j){
        			nsum2 += v[j];
        			j--;

        		}
                sum2 = nsum2;
                total2 += nsum2;
                turn++;
        	}

        }

	cout<<turn-1<<" "<<total1<<" "<<total2<<endl;

    }
}


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

int main(){
    int t;
    cin>>t;
    while(t--){

        int n;
        cin>>n;

        vector<int> v;

        for(int i = 0;i < n;i++){
        	int t;
        	cin>>t;
        	v.push_back(t);
        }

        int turn = 1;
        int sum1 = 0,sum2 = 0;
        int total1 = 0,total2 = 0;
        int i = 0,j = n-1;

        if(n == 1){
            total1 = v[0];
            total2 = 0;
            turn = 2;
        }

        while(i < j){

        	if(turn%2 == 1){

        		while(sum1 <= sum2 && i <= j){
        			sum1 += v[i];
        			total1 += v[i];
        			i++;
        		}
                turn++;
        		sum2 = 0;
        	}else{

        		while(sum2 <= sum1 && i <= j){
        			sum2 += v[j];
        			total2 += v[j];
        			j--;

        		}
                turn++;
        		sum1 = 0;
        	}

        }

    if(i == j && n != 1){
        turn++;
        total2 += v[j];
    }

	cout<<turn-1<<" "<<total1<<" "<<total2<<endl;

    }
}


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

#define ll long long int
#define ull unsigned long long int
#define ldb long double

#define forz(i, n) for (int i = 0; i < n; i++)
#define fore(i, m, n) for (int i = m; i <= n; i++)
#define rforz(i, n) for (int i = n - 1; i >= 0; i--)
#define rfore(i, m, n) for (int i = n; i >= m; i--)
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
//1.gcd(x, y);

//2.Instead of push_back() in STL emplace_back can be used

/*3.  Use of strlen() can be avoided by:
for (i=0; s[i]; i++)
{
}
 loop breaks when the character array ends. */

//5. Number of digits in N =floor(log10(N)) + 1;

//6. copy_n(source, 5, target);::copies 5 elements from source->target

/*7. int a[5] = {0};
char c[3] = {0};

// changes a to {10, 11, 12, 13, 14}
iota(a, a+5, 10);
iota(c, c+3, 'a'); // {'a', 'b', 'c'}*/

//8.binary_search(startaddress, endaddress, valuetofind)-> exists in c++

//9. Creates a vector of size N and values as 0.::vector<int> v(N, 0);
ll power(ll p,ll *end)
{

       ll count=0;
       while(p%9==0)
       {
           p=p/9;
           count++;
       }
       ll x=count;
       if((p-1)%9!=0){*end=1;}
       return x;

}

long long fib(long long n)
{
    if (n <= 1)
        return n;
    return fib(n-1) + fib(n-2);
}

char nth_letter(int n)
{
    return "abcdefghijklmnopqrstuvwxyz"[n];
}

int divisor(int n)
{
	for(ll i=2;i<n/2;i++)
	{
		if(n%i==0)return i;
	}
	return n;
}

int insert(vector <int> v)
{
	ll length=0;
	ll ml=0;
	ll s=-1;
	ll ms=-1;
	if(v[0]==0){s=0;length=1;}
	for(ll i=0;i<v.size();i++)
	{
		if(i==0)continue;
		if(v[i]==0&&i!=0){if(v[i-1]!=0)s=i;length++;}
		else{if(ml<length){ml=length;ms=s;}length=0;}
		//cout<<"length="<<length<<endl;
	}
//	cout<<"length="<<length;
	if(ml<length){ml=length;ms=s;}
//	cout<<"ml="<<ml<<"ms="<<ms<<endl;
	if(ms==-1)return -1;
//	cout<<"ms="<<ms;
	ll x=(ml-1)/2;
//	cout<<"x="<<x;
//	cout<<ms+x<<endl;
	return ms+x;
}

int main()
{
ll tt;
cin>>tt;
while(tt--)
 {
  ll n;cin>>n;
  ll sum=0;
  ll a[n];forz(i,n){cin>>a[i];sum+=a[i];}
  ll alice=0;
  ll bob=0;
  ll prev=0;
  ll curr=0;
  alice=a[0];
  if(n==1){cout<<1<<" "<<alice<<" "<<bob<<"\n";continue;}
  prev=alice;
  ll i=1;ll j=n-1;
  ll count=0;
  ll pc=0;
 // cout<<"curr="<<curr<<" prev="<<prev<<endl;
  while(1)
  {
  	pc++;
  	curr=0;
  	if(alice<bob){while(curr<=prev){curr+=a[i];i++;count++;if(count==n)goto L1;}alice+=curr;prev=curr;if(alice<=bob)break;}
    else if(bob<alice){while(curr<=prev){curr+=a[j];j--;count++;if(count==n)goto L1;}bob+=curr;prev=curr;if(bob<=alice)break;}
  	cout<<"alice="<<alice<<" bob="<<bob<<endl;
  }
  L1:ll g=sum-alice-bob;
  if(g!=0)pc++;
  if(alice<bob)alice+=g;
  else if(bob<alice)bob+=g;
  cout<<pc<<" "<<alice<<" "<<bob<<"\n";
 }
}


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

#define ll long long int
#define ull unsigned long long int
#define ldb long double

#define forz(i, n) for (int i = 0; i < n; i++)
#define fore(i, m, n) for (int i = m; i <= n; i++)
#define rforz(i, n) for (int i = n - 1; i >= 0; i--)
#define rfore(i, m, n) for (int i = n; i >= m; i--)
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
//1.gcd(x, y);

//2.Instead of push_back() in STL emplace_back can be used

/*3.  Use of strlen() can be avoided by:
for (i=0; s[i]; i++)
{
}
 loop breaks when the character array ends. */

//5. Number of digits in N =floor(log10(N)) + 1;

//6. copy_n(source, 5, target);::copies 5 elements from source->target

/*7. int a[5] = {0};
char c[3] = {0};

// changes a to {10, 11, 12, 13, 14}
iota(a, a+5, 10);
iota(c, c+3, 'a'); // {'a', 'b', 'c'}*/

//8.binary_search(startaddress, endaddress, valuetofind)-> exists in c++

//9. Creates a vector of size N and values as 0.::vector<int> v(N, 0);

//TO DO LIST
//1
/*trees and graphs, such as the Kruskal and Prim algorithms, AVL trees,
tries, topological sort, traversals on all kinds of trees, and searches in graphs.*/
//2
/*map*/
//3
//practice in vector
ll power(ll p,ll *end)
{

       ll count=0;
       while(p%9==0)
       {
           p=p/9;
           count++;
       }
       ll x=count;
       if((p-1)%9!=0){*end=1;}
       return x;

}

long long fib(long long n)
{
    if (n <= 1)
        return n;
    return fib(n-1) + fib(n-2);
}

char nth_letter(int n)
{
    return "abcdefghijklmnopqrstuvwxyz"[n];
}

int main()
{
  fastio;   //to reduce time
  ll t;
  cin>>t;
  while(t--)
  {
  ll n;
  cin>>n;
  vector <int> v(n);
  for(ll i=0;i<n;i++)cin>>v[i];
  ll moves=1;
  ll alice=v[0];
 // cout<<"alice="<<alice<<endl;
 if(n==1){cout<<1<<" "<<alice<<" "<<0<<"\n";continue;}
  ll bob=0;
  ll j=n-1;
  ll x=0;
  ll i=1;
  while(1)
  {
  	//	cout<<"i="<<i<<"j="<<j<<endl;
  	if(alice<bob){x=1;moves++;alice=alice+v[i];i++;}
  	if(bob<alice){x=2;bob=bob+v[j];j--;}
  	if(alice==bob&&x==1){moves++;alice=alice+v[i];i++;}
  	if(alice==bob&&x==2){x=2;bob=bob+v[j];j--;}
  	if(i==j+1)break;
  	if(i==j){alice+=v[i];break;}
  //	cout<<"alice="<<alice<<"bob="<<bob<<endl;
  }
  cout<<moves<<" "<<alice<<" "<<bob<<"\n";
  }
}


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

#define ll long long int
#define ull unsigned long long int
#define ldb long double

#define forz(i, n) for (int i = 0; i < n; i++)
#define fore(i, m, n) for (int i = m; i <= n; i++)
#define rforz(i, n) for (int i = n - 1; i >= 0; i--)
#define rfore(i, m, n) for (int i = n; i >= m; i--)
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
//1.gcd(x, y);

//2.Instead of push_back() in STL emplace_back can be used

/*3.  Use of strlen() can be avoided by:
for (i=0; s[i]; i++)
{
}
 loop breaks when the character array ends. */

//5. Number of digits in N =floor(log10(N)) + 1;

//6. copy_n(source, 5, target);::copies 5 elements from source->target

/*7. int a[5] = {0};
char c[3] = {0};

// changes a to {10, 11, 12, 13, 14}
iota(a, a+5, 10);
iota(c, c+3, 'a'); // {'a', 'b', 'c'}*/

//8.binary_search(startaddress, endaddress, valuetofind)-> exists in c++

//9. Creates a vector of size N and values as 0.::vector<int> v(N, 0);
ll power(ll p,ll *end)
{

       ll count=0;
       while(p%9==0)
       {
           p=p/9;
           count++;
       }
       ll x=count;
       if((p-1)%9!=0){*end=1;}
       return x;

}

long long fib(long long n)
{
    if (n <= 1)
        return n;
    return fib(n-1) + fib(n-2);
}

char nth_letter(int n)
{
    return "abcdefghijklmnopqrstuvwxyz"[n];
}

int divisor(int n)
{
	for(ll i=2;i<n/2;i++)
	{
		if(n%i==0)return i;
	}
	return n;
}

int insert(vector <int> v)
{
	ll length=0;
	ll ml=0;
	ll s=-1;
	ll ms=-1;
	if(v[0]==0){s=0;length=1;}
	for(ll i=0;i<v.size();i++)
	{
		if(i==0)continue;
		if(v[i]==0&&i!=0){if(v[i-1]!=0)s=i;length++;}
		else{if(ml<length){ml=length;ms=s;}length=0;}
		//cout<<"length="<<length<<endl;
	}
//	cout<<"length="<<length;
	if(ml<length){ml=length;ms=s;}
//	cout<<"ml="<<ml<<"ms="<<ms<<endl;
	if(ms==-1)return -1;
//	cout<<"ms="<<ms;
	ll x=(ml-1)/2;
//	cout<<"x="<<x;
//	cout<<ms+x<<endl;
	return ms+x;
}

int main()
{
ll tt;
cin>>tt;
while(tt--)
 {
  ll n;cin>>n;
  ll sum=0;
  ll a[n];forz(i,n){cin>>a[i];sum+=a[i];}
  ll alice=0;
  ll bob=0;
  ll prev=0;
  ll curr=0;
  alice=a[0];
  if(n==1){cout<<1<<" "<<alice<<" "<<bob<<"\n";continue;}
  prev=alice;
  ll i=1;ll j=n-1;
  ll count=0;
  ll pc=0;
 // cout<<"curr="<<curr<<" prev="<<prev<<endl;
  while(1)
  {
  	pc++;
  	curr=0;
  	if(alice<bob){while(curr<=prev){curr+=a[i];i++;count++;if(count==n)goto L1;}alice+=curr;prev=curr;if(alice<=bob)break;}
    else if(bob<alice){while(curr<=prev){curr+=a[j];j--;count++;if(count==n)goto L1;}bob+=curr;prev=curr;if(bob<=alice)break;}
  //	cout<<"alice="<<alice<<" bob="<<bob<<endl;
  }
  L1:ll g=sum-alice-bob;
  if(g!=0)pc++;
  if(alice<bob)alice+=g;
  if(bob<alice)bob+=g;
  cout<<pc<<" "<<alice<<" "<<bob<<"\n";
 }
}


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

#define ll long long int
#define ull unsigned long long int
#define ldb long double

#define forz(i, n) for (int i = 0; i < n; i++)
#define fore(i, m, n) for (int i = m; i <= n; i++)
#define rforz(i, n) for (int i = n - 1; i >= 0; i--)
#define rfore(i, m, n) for (int i = n; i >= m; i--)
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
//1.gcd(x, y);

//2.Instead of push_back() in STL emplace_back can be used

/*3.  Use of strlen() can be avoided by:
for (i=0; s[i]; i++)
{
}
 loop breaks when the character array ends. */

//5. Number of digits in N =floor(log10(N)) + 1;

//6. copy_n(source, 5, target);::copies 5 elements from source->target

/*7. int a[5] = {0};
char c[3] = {0};

// changes a to {10, 11, 12, 13, 14}
iota(a, a+5, 10);
iota(c, c+3, 'a'); // {'a', 'b', 'c'}*/

//8.binary_search(startaddress, endaddress, valuetofind)-> exists in c++

//9. Creates a vector of size N and values as 0.::vector<int> v(N, 0);
ll power(ll p,ll *end)
{

       ll count=0;
       while(p%9==0)
       {
           p=p/9;
           count++;
       }
       ll x=count;
       if((p-1)%9!=0){*end=1;}
       return x;

}

long long fib(long long n)
{
    if (n <= 1)
        return n;
    return fib(n-1) + fib(n-2);
}

char nth_letter(int n)
{
    return "abcdefghijklmnopqrstuvwxyz"[n];
}

int divisor(int n)
{
	for(ll i=2;i<n/2;i++)
	{
		if(n%i==0)return i;
	}
	return n;
}

int insert(vector <int> v)
{
	ll length=0;
	ll ml=0;
	ll s=-1;
	ll ms=-1;
	if(v[0]==0){s=0;length=1;}
	for(ll i=0;i<v.size();i++)
	{
		if(i==0)continue;
		if(v[i]==0&&i!=0){if(v[i-1]!=0)s=i;length++;}
		else{if(ml<length){ml=length;ms=s;}length=0;}
		//cout<<"length="<<length<<endl;
	}
//	cout<<"length="<<length;
	if(ml<length){ml=length;ms=s;}
//	cout<<"ml="<<ml<<"ms="<<ms<<endl;
	if(ms==-1)return -1;
//	cout<<"ms="<<ms;
	ll x=(ml-1)/2;
//	cout<<"x="<<x;
//	cout<<ms+x<<endl;
	return ms+x;
}

int main()
{
ll tt;
cin>>tt;
while(tt--)
 {
  ll n;cin>>n;
  ll sum=0;
  ll a[n];forz(i,n){cin>>a[i];sum+=a[i];}
  ll alice=0;
  ll bob=0;
  ll prev=0;
  ll curr=0;
  alice=a[0];
  if(n==1){cout<<1<<" "<<alice<<" "<<bob<<"\n";continue;}
  prev=alice;
  ll i=1;ll j=n-1;
  ll count=0;
  ll pc=0;
 // cout<<"curr="<<curr<<" prev="<<prev<<endl;
  while(1)
  {
  	pc++;
  	curr=0;
  	if(alice<bob){while(curr<=prev){curr+=a[i];i++;count++;if(count==n)goto L1;}alice+=curr;prev=curr;if(alice<=bob)break;}
    else if(bob<alice){while(curr<=prev){curr+=a[j];j--;count++;if(count==n)goto L1;}bob+=curr;prev=curr;if(bob<=alice)break;}
  	//cout<<"alice="<<alice<<" bob="<<bob<<endl;
  }
  L1:ll g=sum-alice-bob;
  if(g!=0)pc++;
  if(alice<bob)alice+=g;
  else if(bob<alice)bob+=g;
  cout<<pc<<" "<<alice<<" "<<bob<<"\n";
 }
}


#include<bits/stdc++.h>
using namespace std;
#define prime       119
#define ll          long long
#define vi          vector<int>
#define vll         vector<long long int>
#define vii         vector<int,int>
#define w(t)        int t;cin>>t;while(t--)
#define f(i,n)      for(int i=0;i<n;i++)

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    w(t)
    {
      int n;
      cin>>n;
      int a[n];
      f(i,n) cin>>a[i];
      if(n==1)
      cout<<a[0]<<" "<<a[0]<<" "<<"0"<endl;
      else{
        int i=1,j=n-1,currs=a[0],curre=0,s=a[0],e=0,moves=1;
        while(i<=j)
        {
            while(curre<=currs&&i<=j)
            {
                curre+=a[j];
                e+=a[j];
                j--;
            }
            currs=0;
            while(currs<=curre&&i<=j)
            {
                currs+=a[i];
                s+=a[i];
                i++;
            }
            moves+=2;
            curre=0;
        }
    cout<<moves-1<<" "<<s<<" "<<e<<endl;
      }
    }

return 0;

}


#include<bits/stdc++.h>
using namespace std;
#define prime       119
#define ll          long long
#define vi          vector<int>
#define vll         vector<long long int>
#define vii         vector<int,int>
#define w(t)        int t;cin>>t;while(t--)
#define f(i,n)      for(int i=0;i<n;i++)

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    w(t)
    {
      int n;
      cin>>n;
      int a[n];
      f(i,n) cin>>a[i];
      if(n==1)
      cout<<a[0]<<" "<<a[0]<<" "<<"0"<<endl;
      else{
        int i=1,j=n-1,currs=a[0],curre=0,s=a[0],e=0,moves=1;
        while(i<=j)
        {
            while(curre<=currs&&i<=j)
            {
                curre+=a[j];
                e+=a[j];
                j--;
            }
            currs=0;
            while(currs<=curre&&i<=j)
            {
                currs+=a[i];
                s+=a[i];
                i++;
            }
            moves+=2;
            curre=0;
        }
    cout<<moves-1<<" "<<s<<" "<<e<<endl;
      }
    }

return 0;

}


#include<bits/stdc++.h>
using namespace std;
#define prime       119
#define ll          long long
#define vi          vector<int>
#define vll         vector<long long int>
#define vii         vector<int,int>
#define w(t)        int t;cin>>t;while(t--)
#define f(i,n)      for(int i=0;i<n;i++)

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    w(t)
    {
      int n;
      cin>>n;
      int a[n];
      f(i,n) cin>>a[i];
      if(n==1)
      cout<<"1"<<" "<<a[0]<<" "<<"0"<endl;
      else{
        int i=1,j=n-1,currs=a[0],curre=0,s=a[0],e=0,moves=1;
        while(i<=j)
        {
            while(curre<=currs&&i<=j)
            {
                curre+=a[j];
                e+=a[j];
                j--;
            }
            currs=0;
            while(currs<=curre&&i<=j)
            {
                currs+=a[i];
                s+=a[i];
                i++;
            }
            moves+=2;
            curre=0;
        }
    cout<<moves-1<<" "<<s<<" "<<e<<endl;
      }
    }

return 0;

}


#include<bits/stdc++.h>
using namespace std;
#define prime       119
#define ll          long long
#define vi          vector<int>
#define vll         vector<long long int>
#define vii         vector<int,int>
#define w(t)        int t;cin>>t;while(t--)
#define f(i,n)      for(int i=0;i<n;i++)

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    w(t)
    {
      int n;
      cin>>n;
      int a[n];
      f(i,n) cin>>a[i];
        int i=1,j=n-1,currs=a[0],curre=0,s=a[0],e=0,moves=1;
        while(i<=j)
        {
            while(curre<=currs&&i<=j)
            {
                curre+=a[j];
                e+=a[j];
                j--;
            }
            currs=0;
            while(currs<=curre&&i<=j)
            {
                currs+=a[i];
                s+=a[i];
                i++;
            }
            moves+=2;
            curre=0;
        }

    cout<<moves-1<<" "<<s<<" "<<e<<endl;
    }

return 0;

}


#include<bits/stdc++.h>
using namespace std;
#define prime       119
#define ll          long long
#define vi          vector<int>
#define vll         vector<long long int>
#define vii         vector<int,int>
#define w(t)        int t;cin>>t;while(t--)
#define f(i,n)      for(int i=0;i<n;i++)

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    w(t)
    {
      int n;
      cin>>n;
      int a[n];
      f(i,n) cin>>a[i];
      if(n==1)
      cout<<"1"<<" "<<a[0]<<" "<<"0"<<endl;
      else{
        int i=1,j=n-1,currs=a[0],curre=0,s=a[0],e=0,moves=1;
        while(i<=j)
        {
            while(curre<=currs&&i<=j)
            {
                curre+=a[j];
                e+=a[j];
                j--;
            }
            currs=0;
            while(currs<=curre&&i<=j)
            {
                currs+=a[i];
                s+=a[i];
                i++;
            }
            moves+=2;
            curre=0;
        }
    cout<<moves-1<<" "<<s<<" "<<e<<endl;
      }
    }

return 0;

}


#include <bits/stdc++.h>

using namespace std;

int main() {
	int t;
	cin >> t;
	while (t--) {
		int n;
		cin >> n;
		vector<int> a(n);
		for (auto &it : a) cin >> it;
		int l = 0, r = n - 1;
		int suml = 0, sumr = 0;
		int cnt = 0, ansl = 0, ansr = 0;
		while (l <= r) {
			if (cnt % 2 == 0) {
				int nsuml = 0;
				while (l <= r && nsuml <= sumr) {
					nsuml += a[l++];
				}
				ansl += nsuml;
				suml = nsuml;
			} else {
				int nsumr = 0;
				while (l <= r && nsumr <= suml) {
					nsumr += a[r--];
				}
				ansr += nsumr;
				sumr = nsumr;
			}
			++cnt;
		}
		cout << cnt << " " << ansl << " " << ansr << endl;
	}
}


    #include <bits/stdc++.h>

    using namespace std;

    int main()
    {
        int t;
        cin >> t;
        for (int o = 0; o < t; o++)
        {
            int n, a = 0, b = 0, bans = 0, aans = 0, hod = 1;
            cin >> n;
            vector <int> ar(n);
            for (int i = 0; i < n; i++) cin >> ar[i];
            if (n == 1) cout << 1 << " " << ar[0] << " " << 0;
            else
            {
            a = ar[0];
            ar.erase(ar.begin());
            aans += a;
            while(ar.size())
            {
                if (ar.size() > 0) hod++;
                b = 0;
                for (int i = ar.size() - 1; b <= a && i >= 0; i--)
                {
                    b+=ar[i];
                   // cout << ar[i] << '\n';
                    ar.erase(ar.end() - 1);
                }
                bans += b;
                a = 0;
                if (ar.size() > 0) hod++;
                //cout << "---------\n";
                for (int i = 0; a <= b && i < ar.size(); i++)
                {
                    a+=ar[i];
                    //cout << ar[i] << '\n';
                    ar.erase(ar.begin());
                    i--;
                }
                aans+= a;
                //system("pause");
    //            cout << ar.size() << '\n';
    //            system("pause");
            }
            cout << hod << " " << aans << " " << bans << '\n';
            }
        }
        return 0;
    }


    #include <bits/stdc++.h>

    using namespace std;

    int main()
    {
        int t;
        cin >> t;
        for (int o = 0; o < t; o++)
        {
            int n, a = 0, b = 0, bans = 0, aans = 0, hod = 1;
            cin >> n;
            vector <int> ar(n);
            for (int i = 0; i < n; i++) cin >> ar[i];
            if (n == 1) cout << 1 << " " << ar[0] << " " << 0 << '\n';
            else
            {
            a = ar[0];
            ar.erase(ar.begin());
            aans += a;
            while(ar.size())
            {
                if (ar.size() > 0) hod++;
                b = 0;
                for (int i = ar.size() - 1; b <= a && i >= 0; i--)
                {
                    b+=ar[i];
                   // cout << ar[i] << '\n';
                    ar.erase(ar.end() - 1);
                }
                bans += b;
                a = 0;
                if (ar.size() > 0) hod++;
                //cout << "---------\n";
                for (int i = 0; a <= b && i < ar.size(); i++)
                {
                    a+=ar[i];
                    //cout << ar[i] << '\n';
                    ar.erase(ar.begin());
                    i--;
                }
                aans+= a;
                //system("pause");
    //            cout << ar.size() << '\n';
    //            system("pause");
            }
            cout << hod << " " << aans << " " << bans << '\n';
            }
        }
        return 0;
    }


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int t;
    cin >> t;
    for (int o = 0; o < t; o++)
    {
        int n, a = 0, b = 0, bans = 0, aans = 0, hod = 1;
        cin >> n;
        vector <int> ar(n);
        for (int i = 0; i < n; i++) cin >> ar[i];
        if (n == 1) cout << 1 << " " << ar[0] << " " << 0;
        else
        {
        a = ar[0];
        ar.erase(ar.begin());
        aans += a;
        while(ar.size())
        {
            if (ar.size() > 0) hod++;
            b = 0;
            for (int i = ar.size() - 1; b <= a && i >= 0; i--)
            {
                b+=ar[i];
               // cout << ar[i] << '\n';
                ar.erase(ar.end() - 1);
            }
            bans += b;
            a = 0;
            if (ar.size() > 0) hod++;
            //cout << "---------\n";
            for (int i = 0; a <= b && i < ar.size(); i++)
            {
                a+=ar[i];
                //cout << ar[i] << '\n';
                ar.erase(ar.begin());
                i--;
            }
            aans+= a;
            //system("pause");
//            cout << ar.size() << '\n';
//            system("pause");
        }
        cout << hod << " " << aans << " " << bans << '\n';
        }
    }
    return 0;
}


/*

            Question ID->
                                       */
#include<bits/stdc++.h>
#include<cmath>
#include<cstring>
#include<climits>
#define int long long
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
#define asc(a,n) sort(a,a+n);
#define dsc(a,n) sort(a,a+n,comp);
#define fo(i,x,y) for(int i=x;i<y;i++)
#define inarr(x) int n; cin>>n; int x[n]; fo(i,0,n){cin>>x[i];}
#define test int t; cin>>t; while(t--)
using namespace std;

int basic(){freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);return 0;}
bool comp(int a,int b){return a>b;}

int alice=0;
int alst=-1,blst; int cnt=0;
int func(int a[],int n,int lmt,int *st)
{ if(*st==0)
  { if (alst==blst){return 0;}
    int sum=0;
     for(int i=alst+1; ;i++)
     {  if (i==blst){return sum;}
        if(a[i]==0){alst=i-1; return 0;}
        sum+=a[i]; alice+=a[i];a[i]=0; //cnt++;
        if(sum>lmt){alst=i;  *st=1; return sum;}
     }
     //alice+=sum; *st=1;
     return sum;
  }
  else if(*st==1)
  { if(blst==alst){return 0;}
    int sum=0;
    for(int i=blst-1;;i--)
    { if(i==alst){return sum;}
      //if(a[i]==0){return 0;}
      sum+=a[i]; a[i]=0;  //cnt++;
      if(sum>lmt){blst=i; *st=0; return sum;}
    }
    *st=0;
    return sum;
  }
return 0;
}

int32_t main()
{
  //basic();
  fast;
  test
  { int tot=0; //int alice=0;
    inarr(a);
    fo(i,0,n)
    {
       tot+=a[i];
    }
    blst=n;
    int lmt=0; int st=0;
        for(int i=0;;i++)
            {
              lmt=func(a,n,lmt,&st);
               //cout<<lmt<<" "<<cnt<<" "<<st<<"\n";
              //cout<<alice<<" ";
              if(lmt==0){break;} cnt++;
            }
    int bob;
    // fo(i,0,alst+1)
    // {
    //    alice+=a[i];
    // }
    //int bob=tot-alice;
    cout<<cnt<<" "<<alice<<" "<<tot-alice<<endl;
     alice=0;
     alst=-1,cnt=0;

  }
  return 0;
}


/*

            Question ID->
                                       */
#include<bits/stdc++.h>
#include<cmath>
#include<cstring>
#include<climits>
#define int long long
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
#define asc(a,n) sort(a,a+n);
#define dsc(a,n) sort(a,a+n,comp);
#define fo(i,x,y) for(int i=x;i<y;i++)
#define inarr(x) int n; cin>>n; int x[n]; fo(i,0,n){cin>>x[i];}
#define test int t; cin>>t; while(t--)
using namespace std;

int basic(){freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);return 0;}
bool comp(int a,int b){return a>b;}

int alice=0;
int alst=-1,blst; int cnt=0;
int func(int a[],int n,int lmt,int *st)
{ if(*st==0)
  { if (alst==blst){return 0;}
    int sum=0;
     for(int i=alst+1; ;i++)
     {  if (i==blst){return sum;}
        if(a[i]==0){alst=i-1; return 0;}
        sum+=a[i]; a[i]=0; //cnt++;
        if(sum>lmt){alst=i; alice+=sum; *st=1; return sum;}
     }
  }
  else if(*st==1)
  { if(blst==alst){return 0;}
    int sum=0;
    for(int i=blst-1;;i--)
    { if(i==alst){return sum;}
      if(a[i]==0){return 0;}
      sum+=a[i]; a[i]=0;  //cnt++;
      if(sum>lmt){blst=i; *st=0; return sum;}
    }
  }
return 0;
}

int32_t main()
{
  //basic();
  fast;
  test
  { int tot=0; //int alice=0;
    inarr(a);
    fo(i,0,n)
    {
       tot+=a[i];
    }
    blst=n;
    int lmt=0; int st=0;
        for(int i=0;;i++)
            { //cout<<lmt<<" "<<cnt<<" "<<st<<"\n";
              lmt=func(a,n,lmt,&st);

              if(lmt==0){break;} cnt++;
            }
    int bob;
    // fo(i,0,alst+1)
    // {
    //    alice+=a[i];
    // }
    //int bob=tot-alice;
    cout<<cnt<<" "<<alice<<" "<<tot-alice<<endl;
     alice=0;
     alst=-1,cnt=0;

  }
  return 0;
}


/*

            Question ID->
                                       */
#include<bits/stdc++.h>
#include<cmath>
#include<cstring>
#include<climits>
#define int long long
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
#define asc(a,n) sort(a,a+n);
#define dsc(a,n) sort(a,a+n,comp);
#define fo(i,x,y) for(int i=x;i<y;i++)
#define inarr(x) int n; cin>>n; int x[n]; fo(i,0,n){cin>>x[i];}
#define test int t; cin>>t; while(t--)
using namespace std;

int basic(){freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);return 0;}
bool comp(int a,int b){return a>b;}

int alice=0;
int alst=-1,blst; int cnt=0;
int func(int a[],int n,int lmt,int *st)
{ if(*st==0)
  {
    int sum=0;
     for(int i=alst+1; ;i++)
     {  if (i==blst){return sum;}

        sum+=a[i]; alice+=a[i];a[i]=0;
        if(sum>lmt){alst=i;  *st=1; return sum;}
     }

     return sum;
  }
  else if(*st==1)
  {
    int sum=0;
    for(int i=blst-1;;i--)
    { if(i==alst){return sum;}

      sum+=a[i]; a[i]=0;
      if(sum>lmt){blst=i; *st=0; return sum;}
    }
    *st=0;
    return sum;
  }
return 0;
}

int32_t main()
{

  fast;
  test
  { int tot=0;
    inarr(a);
    fo(i,0,n)
    {
       tot+=a[i];
    }
    blst=n;
    int lmt=0; int st=0;
        for(int i=0;;i++)
            {
              lmt=func(a,n,lmt,&st);

              if(lmt==0){break;} cnt++;
            }
    int bob;

    cout<<cnt<<" "<<alice<<" "<<tot-alice<<endl;
     alice=0;
     alst=-1,cnt=0;

  }
  return 0;
}


/*

            Question ID->
                                       */
#include<bits/stdc++.h>
#include<cmath>
#include<cstring>
#include<climits>
#define int long long
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
#define asc(a,n) sort(a,a+n);
#define dsc(a,n) sort(a,a+n,comp);
#define fo(i,x,y) for(int i=x;i<y;i++)
#define inarr(x) int n; cin>>n; int x[n]; fo(i,0,n){cin>>x[i];}
#define test int t; cin>>t; while(t--)
using namespace std;

int basic(){freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);return 0;}
bool comp(int a,int b){return a>b;}

int alice=0;
int alst=-1,blst; int cnt=0;
int func(int a[],int n,int lmt,int *st)
{ if(*st==0)
  { if (alst==blst){return 0;}
    int sum=0;
     for(int i=alst+1; ;i++)
     {  if (i==blst){return sum;}
        //if(a[i]==0){alst=i-1; return 0;}
        sum+=a[i]; alice+=a[i];a[i]=0; //cnt++;
        if(sum>lmt){alst=i;  *st=1; return sum;}
     }
     //alice+=sum; *st=1;
     return sum;
  }
  else if(*st==1)
  { if(blst==alst){return 0;}
    int sum=0;
    for(int i=blst-1;;i--)
    { if(i==alst){return sum;}
      //if(a[i]==0){return 0;}
      sum+=a[i]; a[i]=0;  //cnt++;
      if(sum>lmt){blst=i; *st=0; return sum;}
    }
    *st=0;
    return sum;
  }
return 0;
}

int32_t main()
{
 // basic();
  fast;
  test
  { int tot=0; //int alice=0;
    inarr(a);
    fo(i,0,n)
    {
       tot+=a[i];
    }
    blst=n;
    int lmt=0; int st=0;
        for(int i=0;;i++)
            {
              lmt=func(a,n,lmt,&st);
               //cout<<lmt<<" "<<cnt<<" "<<st<<"\n";
              //cout<<alice<<" ";
              if(lmt==0){break;} cnt++;
            }
    int bob;
    // fo(i,0,alst+1)
    // {
    //    alice+=a[i];
    // }
    //int bob=tot-alice;
    cout<<cnt<<" "<<alice<<" "<<tot-alice<<endl;
     alice=0;
     alst=-1,cnt=0;

  }
  return 0;
}


#include<bits/stdc++.h>
#define mod 1000000009
#define ll long long
using namespace std;
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int n,a[1005];
        scanf("%d",&n);
        for(int i=0; i<n; i++)
            scanf("%d",&a[i]);
        int A=0,B=0;
        int last=0;
        int k=0;
        for(int l=0,r=n-1; l<=r;)
        {
            int tmp=0;
            while(last>=0)
            {
                last-=a[l];
                tmp+=a[l];
                l++;
            }
            k++;
            last=tmp;
            A+=tmp;
            tmp=0;
            if(l<r)
                k++;
            while(last>=0&&l<=r)
            {
                last-=a[r];
                tmp+=a[r];
                r--;
            }

            B+=tmp;
            last=tmp;
        }
        printf("%d %d %d\n",k,A,B);
    }
    return 0;
}


#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int t,n,a[200005];
int main()
{
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d",&n);
        int sl=0,sr=0,lastl=0,lastr=0;
        int l=1,r=n;
        int cnt=0;
        for(int i=1; i<=n; i++)
            scanf("%d",&a[i]);
        while(l<=r)
        {
            cnt++;//记录运动几回
            lastl=0;//每次归零，跟lastr比较
            while(l<=r&&lastl<=lastr)
                lastl+=a[l],sl+=a[l++];//临时存储上一步A走的大小，统计A走的全部糖果
            if(l>r)//过程中判断，不正常直接跳出
                break;
            cnt++;
            lastr=0;//每次归零，跟lastl比较
            while(l<=r&&lastr<=lastl)
                lastr+=a[r],sr+=a[r--];//临时存储上一步B走的大小，统计B走的全部糖果
        }
        printf("%d %d %d\n",cnt,sl,sr);
    }
    return 0;
}


#include<bits/stdc++.h>
#define mod 1000000009
#define ll long long
using namespace std;
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int n,a[1005];
        scanf("%d",&n);
        for(int i=0; i<n; i++)
            scanf("%d",&a[i]);
        int A=0,B=0;
        int last=0;
        int k=0;
        for(int l=0,r=n-1; l<=r;)
        {
            int tmp=0;
            while(last>=0)
            {
                last-=a[l];
                tmp+=a[l];
                l++;
            }
            k++;
            last=tmp;
            A+=tmp;
            tmp=0;
            if(l<=r)
                k++;
            while(last>=0&&l<=r)
            {
                last-=a[r];
                tmp+=a[r];
                r--;
            }

            B+=tmp;
            last=tmp;
        }
        printf("%d %d %d\n",k,A,B);
    }
    return 0;
}


#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int t,n,a[200005];
int main()
{
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d",&n);
        int sl=0,sr=0,lastl=0,lastr=0;
        int l=1,r=n;
        int cnt=0;
        for(int i=1; i<=n; i++)
            scanf("%d",&a[i]);
        while(l<=r)
        {
            cnt++;
            lastl=0;
            while(lastl<=lastr&&l<=r)
            {
                lastl+=a[l];
                sl+=a[l];
                l++;
            }
            if(l>r)
                break;
            cnt++;
            lastr=0;
            while(lastr<=lastl&&l<=r)
            {
                lastr+=a[r];
                sr+=a[r];
                r--;
            }
        }
        printf("%d %d %d\n",cnt,sl,sr);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define forn(n) for(int i=0;i<n;i++)
#define f(a,b) for(int i=a;i<=b;i++)
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define mp make_pair
#define mod (1000*1000*1000+7)
#define pi (22/7.0)
#define sq(x) x*x
#define test ll t; cin>>t; while(t--)
int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    test;
    {
	   int n;
	   cin >> n;
	   int a[n];
	   forn(n)
	   {
	   	  cin >> a[i];
	   }
	   int curr=0,prev=0,l=0 ,r=n-1;
	   ll count=0,alice=0,bob=0;
	   while(l<=r)
	   {
	   	    while(curr<=prev&&l<=r)
	   	    {
	   	      	curr+=a[l];
	   	      	l++;
	   	    }
	   	    if(curr) count++;
	   	    prev=curr;
	   	    alice+=curr;
	   	    c
	   	    while(curr<=prev&&l<=r)
	   	    {
	   	       curr+= a[r];
	   	       r--;
			}
			if(curr) count++;
			bob+=curr;
			prev=curr;
			curr=0;
	    }
	    cout<<count<<" "<<alice<<" "<<bob<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define forn(n) for(int i=0;i<n;i++)
#define f(a,b) for(int i=a;i<=b;i++)
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define mp make_pair
#define mod (1000*1000*1000+7)
#define pi (22/7.0)
#define sq(x) x*x
#define test ll t; cin>>t; while(t--)
int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    test;
    {
	   int n;
	   cin >> n;
	   int a[n];
	   forn(n)
	   {
	   	  cin >> a[i];
	   }
	   int curr=0,prev=0,l=0 ,r=n-1;
	   ll count=0,alice=0,bob=0;
	   while(l<=r)
	   {
	   	    while(curr<=prev&&l<=r)
	   	    {
	   	      	curr+=a[l];
	   	      	l++;
	   	    }
	   	    if(curr) count++;
	   	    prev=curr;
	   	    alice+=curr;
	   	    while(curr<=prev&&l<=r)
	   	    {
	   	       curr+= a[r];
	   	       r--;
			}
			if(curr) count++;
			bob+=curr;
			prev=curr;
			curr=0;
	    }
	    cout<<count<<" "<<alice<<" "<<bob<<endl;
	}
	return 0;
}


#include<cmath>
#include<iterator>
#include<map>
#include<cstdio>
#include<iostream>
#define long long int ll;
using namespace std;
/*bool is_prime(ll n)
{
    if(n==2)return 1;
    int q=sqrt(n);
    for(int i=2;i<=q;i++){
        if(n%i==0)return 0;
    }
    return 1;
}
ll square(ll x)
{
    return x*x;
}
ll bigmod(ll b,ll p,ll m)
{
    if(p==0)return 1;
    else if(p%2==0)return square(bigmod(b,p/2,m))%m;
    else return ((b%m)*bigmod(b,p-1,m))%m;
}
ll power(ll a,ll b)
{
    int i=0;
    int m=b;
    if(a%b==0){
    for(int q=1;;q++){
        b*=b;
        if(a%b!=0){
            return b/m;
        }
    }
    }
    else return 1;
}*/
int main()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        int p;
        cin>>p;
        int ara[p];
        for(int k=0;k<p;k++){
            scanf("%d",&ara[k]);
        }
        int u=0,j=1,sum1=0,sum2=0,sum=0,sum3=0,cnt=0;
        while(1){
        while(sum1<=sum2 && ara[u]){
            sum1+=ara[u];
            sum+=ara[u];
            ara[u]=0;
            u++;
        }
        cnt++;
        sum2=0;
        //cout<<cnt<<" "<<sum<<" "<<sum3<<"\n";
        if(ara[u]==0)break;
        while(sum2<=sum1 && ara[p-j]){
            sum2+=ara[p-j];
            sum3+=ara[p-j];
            ara[p-j]=0;
            j++;
        }
        cnt++;
        sum1=0;
        //cout<<cnt<<" "<<sum<<" "<<sum3<<"\n";
        if(ara[p-j]==0)break;
        }
        printf("%d %d %d\n",cnt,sum,sum3);
    }
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		ll n, a[1010], suma=0, sumb=0, cnt=0, maxx=0, sum=0;
		cin>>n;
		for(int i=0; i<n; i++)
		{
			cin>>a[i];
		}
		ll l=1, r=n-1;
		suma=a[0];
		cnt++;
		maxx=a[0];
		while(l<=r)
		{
			while(sum<=maxx)
			{
				if(l>r)
					break;
				sum+=a[r--];
			}
			maxx=sum;
			cnt++;
			sumb+=sum;
			sum=0;
			if(l>r)
				break;
			while(sum<=maxx)
			{
				if(l>r)
					break;
				sum+=a[l++];
			}
			maxx=sum;
			cnt++;
			suma+=sum;
			sum=0;
		}
		cout<<cnt<<" "<<suma<<" "<<sumb<<endl;
	}
}


/*
Writer: Jitesh Singla
7
11
3 1 4 1 5 9 2 6 5 3 5

3 1 4 1 5 9
5 3 5 2 6

1
3
*/

#include<bits/stdc++.h>
#define int long long int
#define pb push_back
#define mk make_pair
#define endl "\n"
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
int MOD = 1000000007;
int arr[200002];
signed main()
{
	int test;
	cin >> test;
	while(test--)
	{
		int n;
		cin >> n;
		for(int i=0;i<n;i++)
		cin >> arr[i];

		if(n==1)
		{
			cout << 1 << " " << arr[0] << " 0\n";
			continue;
		}

		int i=0;
		int j=n-1;
		int a=0,b=0,m=0;
		int prev=0;
		while(i<j)
		{
		//	cout << i << " " << j << " " << m << endl;
			m++;

			int ca = arr[i];
			while(i<=j && ca<=prev)
			{
				i++;
				ca+=arr[i];
			}
			a+=ca;
			if(i>=j || ca<=prev)
			break;

			prev=ca;
			m++;

			int cb = arr[j];
			while(j-1>=0 && j-1>i && cb<=prev)
			{
				j--;
				cb+=arr[j];
			}

			b+=cb;
			if(cb<=prev)
			break;
			i++;
			j--;
			prev=cb;
			if(i>=j)
			break;

		}
		cout << m << " " << a << " " << b << endl;
	}

	return 0;

}


/*
Writer: Jitesh Singla
7
11
3 1 4 1 5 9 2 6 5 3 5

3 1 4 1 5 9
5 3 5 2 6

*/

#include<bits/stdc++.h>
#define int long long int
#define pb push_back
#define mk make_pair
#define endl "\n"
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
int MOD = 1000000007;
int arr[200002];
signed main()
{
	int test;
	cin >> test;
	while(test--)
	{
		int n;
		cin >> n;
		for(int i=0;i<n;i++)
		cin >> arr[i];

		if(n==1)
		{
			cout << 1 << " " << arr[0] << " 0\n";
			continue;
		}

		int i=0;
		int j=n-1;
		int a=0,b=0,m=0;
		int prev=0;
		while(i<j)
		{
		//	cout << i << " " << j << " " << m << endl;
			m++;

			int ca = arr[i];
			while(i+1<=j && ca<=prev)
			{
				i++;
				ca+=arr[i];
			}
			a+=ca;
			if(i>=j || ca<=prev)
			break;

			prev=ca;
			m++;

			int cb = arr[j];
			while(j-1>=0 && j-1>i && cb<=prev)
			{
				j--;
				cb+=arr[j];
			}

			b+=cb;
			if(cb<=prev)
			break;
			i++;
			j--;
			prev=cb;
			if(i>=j)
			break;

		}
		cout << m << " " << a << " " << b << endl;
	}

	return 0;

}


/*
Writer: Jitesh Singla
7
11
3 1 4 1 5 9 2 6 5 3 5

3 1 4 1 5 9
5 3 5 2 6

1
3
*/

#include<bits/stdc++.h>
#define int long long int
#define pb push_back
#define mk make_pair
#define endl "\n"
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
int MOD = 1000000007;
int arr[200002];
signed main()
{
	int test;
	cin >> test;
	while(test--)
	{
		int n;
		cin >> n;
		for(int i=0;i<n;i++)
		cin >> arr[i];

		if(n==1)
		{
			cout << 1 << " " << arr[0] << " 0\n";
			continue;
		}

		int i=0;
		int j=n-1;
		int a=0,b=0,m=0;
		int prev=0;
		while(i<=j)
		{
		//	cout << i << " " << j << " " << m << endl;
			m++;

			int ca = arr[i];
			while(i+1<=j && ca<=prev)
			{
				i++;
				ca+=arr[i];
			}
			a+=ca;
			if(i>=j || ca<=prev)
			break;

			prev=ca;
			m++;

			int cb = arr[j];
			while(j-1>=0 && j-1>i && cb<=prev)
			{
				j--;
				cb+=arr[j];
			}

			b+=cb;
			if(cb<=prev)
			break;
			i++;
			j--;
			prev=cb;

		}
		cout << m << " " << a << " " << b << endl;
	}

	return 0;

}


/*
Writer: Jitesh Singla
7
11
3 1 4 1 5 9 2 6 5 3 5

3 1 4 1 5 9
5 3 5 2 6

1
3
*/

#include<bits/stdc++.h>
#define int long long int
#define pb push_back
#define mk make_pair
#define endl "\n"
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
int MOD = 1000000007;
int arr[200002];
signed main()
{
	int test;
	cin >> test;
	while(test--)
	{
		int n;
		cin >> n;
		for(int i=0;i<n;i++)
		cin >> arr[i];

		if(n==1)
		{
			cout << 1 << " " << arr[0] << " 0\n";
			continue;
		}

		int i=0;
		int j=n-1;
		int a=0,b=0,m=0;
		int prev=0;
		while(i<j)
		{
		//	cout << i << " " << j << " " << m << endl;
			m++;

			int ca = arr[i];
			while(i+1<=j && ca<=prev)
			{
				i++;
				ca+=arr[i];
			}
			a+=ca;
			if(i>=j || ca<=prev)
			break;

			prev=ca;
			m++;

			int cb = arr[j];
			while(j-1>=0 && j-1>i && cb<=prev)
			{
				j--;
				cb+=arr[j];
			}

			b+=cb;
			if(cb<=prev)
			break;
			i++;
			j--;
			prev=cb;
			if(i>=j)
			break;

		}
		cout << m << " " << a << " " << b << endl;
	}

	return 0;

}


/*
Writer: Jitesh Singla
7
11
3 1 4 1 5 9 2 6 5 3 5

3 1 4 1 5 9
5 3 5 2 6

*/

#include<bits/stdc++.h>
#define int long long int
#define pb push_back
#define mk make_pair
#define endl "\n"
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
int MOD = 1000000007;
int arr[200002];
signed main()
{
	int test;
	cin >> test;
	while(test--)
	{
		int n;
		cin >> n;
		for(int i=0;i<n;i++)
		cin >> arr[i];

		if(n==1)
		{
			cout << 1 << " " << arr[0] << " 0\n";
			continue;
		}

		int i=0;
		int j=n-1;
		int a=0,b=0,m=0;
		int prev=0;
		while(i<j)
		{
			cout << i << " " << j << " " << m << endl;
			m++;

			int ca = arr[i];
			while(i+1<=j && ca<=prev)
			{
				i++;
				ca+=arr[i];
			}
			a+=ca;
			if(i>=j || ca<=prev)
			break;

			prev=ca;
			m++;

			int cb = arr[j];
			while(j-1>=0 && j-1>i && cb<=prev)
			{
				j--;
				cb+=arr[j];
			}

			b+=cb;
			if(cb<=prev)
			break;
			i++;
			j--;
			prev=cb;
			if(i>=j)
			break;

		}
		cout << m << " " << a << " " << b << endl;
	}

	return 0;

}


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

/********************************************************************/
#define M1 1000000007
#define M3 1000000009
#define M2 998244353
#define ll long long
#define pll pair<ll,ll>
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define REPR(i,a,b) for(ll i=b-1;i>=a;i--)
#define forr(i,n) for(ll i=0;i<n;i++)
#define F first
#define S second
#define pb push_back
#define DB pop_back
#define mp make_pair
#define MT make_tuple
#define V(a) vector<a>
#define vi vector<ll>
#define endl '\n'
#define ce(ele) cout<<ele<<' '
#define cs(ele) cout<<ele<<'\n'
#define CASE(t) ll t; cin>>t; while(t--)
#define sort(v) sort(v.begin(),v.end())

/********************************************************************/
const double pi = 3.1415926535;
ll n, m;
const int mx = 69;
char grid[mx][mx];
ll blocked[mx][mx];
ll vis[mx][mx];
/********************************************************************/
//FAST IO//
void FAST() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}

/********************************************************************/

ll power(ll a, ll b)
{
	ll res = 1;
	for (int i = 1; i <= b; ++i)
		res *= a;

	return res;
}
ll sum(ll x) {
	ll ans = 0;
	while (x > 0) {
		ans += (x % 10);
		x /= 10;
	}
	return ans;
}
int main()
{
  FAST();
  CASE(t)
  {
    ll n;
    cin>>n;
    vi v;
    forr(i,n)
    {
    	ll a;cin>>a;
    	v.pb(a);
    }
    if(n==1)
    {
    	cout<<1<<" "<<v[0]<<" "<<0<<"\n";
    }
    else
    {
	    ll sum=0,temp,flag=0,i=0,j=n-1,sumb=0,tempb=0,moves=0,al=0,bo=0;
	    while(i<j)
	    {
	    	temp=0,tempb=0,flag=0;
	    	while(temp<=sum && i<=j)
		    {
		    	temp+=v[i];
		    	al+=v[i];
		    	// cout<<v[i]<<" ";
		    	i++;
		    }
		    sumb=temp;

		    // if(i<j)
		    moves++;
		    while(tempb<=sumb && i<=j)
		    {
		    	tempb+=v[j];
		    	bo+=v[j];
		        // cout<<v[j]<<" ";
		    	j--;
		    	flag=1;
		    }
		    sum=tempb;
		    if(flag)
		     moves++;
	    }

	     cout<<moves<<" "<<al<<" "<<bo<<endl;
    }

  }
}


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

/********************************************************************/
#define M1 1000000007
#define M3 1000000009
#define M2 998244353
#define ll long long
#define pll pair<ll,ll>
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define REPR(i,a,b) for(ll i=b-1;i>=a;i--)
#define forr(i,n) for(ll i=0;i<n;i++)
#define F first
#define S second
#define pb push_back
#define DB pop_back
#define mp make_pair
#define MT make_tuple
#define V(a) vector<a>
#define vi vector<ll>
#define endl '\n'
#define ce(ele) cout<<ele<<' '
#define cs(ele) cout<<ele<<'\n'
#define CASE(t) ll t; cin>>t; while(t--)
#define sort(v) sort(v.begin(),v.end())

/********************************************************************/
const double pi = 3.1415926535;
ll n, m;
const int mx = 69;
char grid[mx][mx];
ll blocked[mx][mx];
ll vis[mx][mx];
/********************************************************************/
//FAST IO//
void FAST() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}

/********************************************************************/

ll power(ll a, ll b)
{
	ll res = 1;
	for (int i = 1; i <= b; ++i)
		res *= a;

	return res;
}
ll sum(ll x) {
	ll ans = 0;
	while (x > 0) {
		ans += (x % 10);
		x /= 10;
	}
	return ans;
}
int main()
{
  FAST();
  CASE(t)
  {
    ll n;
    cin>>n;
    vi v;
    forr(i,n)
    {
    	ll a;cin>>a;
    	v.pb(a);
    }
    if(n==1)
    {
    	cout<<1<<" "<<v[0]<<" "<<0<<"\n";
    }
    else
    {
	    ll sum=0,temp,flag=0,i=0,j=n-1,sumb=0,tempb=0,moves=0,al=0,bo=0;
	    while(i<=j)
	    {
	    	temp=0,tempb=0,flag=0;
	    	while(temp<=sum && i<=j)
		    {
		    	temp+=v[i];
		    	al+=v[i];
		    	// cout<<v[i]<<" ";
		    	i++;
		    }
		    sumb=temp;

		    // if(i<j)
		    moves++;
		    while(tempb<=sumb && i<=j)
		    {
		    	tempb+=v[j];
		    	bo+=v[j];
		        // cout<<v[j]<<" ";
		    	j--;
		    	flag=1;
		    }
		    sum=tempb;
		    if(flag)
		     moves++;
	    }

	     cout<<moves<<" "<<al<<" "<<bo<<endl;
    }

  }
}


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

/********************************************************************/
#define M1 1000000007
#define M3 1000000009
#define M2 998244353
#define ll long long
#define pll pair<ll,ll>
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define REPR(i,a,b) for(ll i=b-1;i>=a;i--)
#define forr(i,n) for(ll i=0;i<n;i++)
#define F first
#define S second
#define pb push_back
#define DB pop_back
#define mp make_pair
#define MT make_tuple
#define V(a) vector<a>
#define vi vector<ll>
#define endl '\n'
#define ce(ele) cout<<ele<<' '
#define cs(ele) cout<<ele<<'\n'
#define CASE(t) ll t; cin>>t; while(t--)
#define sort(v) sort(v.begin(),v.end())

/********************************************************************/
const double pi = 3.1415926535;
ll n, m;
const int mx = 69;
char grid[mx][mx];
ll blocked[mx][mx];
ll vis[mx][mx];
/********************************************************************/
//FAST IO//
void FAST() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}

/********************************************************************/

ll power(ll a, ll b)
{
	ll res = 1;
	for (int i = 1; i <= b; ++i)
		res *= a;

	return res;
}
ll sum(ll x) {
	ll ans = 0;
	while (x > 0) {
		ans += (x % 10);
		x /= 10;
	}
	return ans;
}
int main()
{
  FAST();
  CASE(t)
  {
    ll n;
    cin>>n;
    vi v;
    forr(i,n)
    {
    	ll a;cin>>a;
    	v.pb(a);
    }
    if(n==1)
    {
    	cout<<1<<" "<<v[0]<<"\n";
    }
    else
    {
	    ll sum=0,temp,flag=0,i=0,j=n-1,sumb=0,tempb=0,moves=0,al=0,bo=0;
	    while(i<=j)
	    {
	    	temp=0,tempb=0,flag=0;
	    	while(temp<=sum && i<=j)
		    {
		    	temp+=v[i];
		    	al+=v[i];
		    	// cout<<v[i]<<" ";
		    	i++;
		    }
		    sumb=temp;

		    // if(i<j)
		    moves++;
		    while(tempb<=sumb && i<=j)
		    {
		    	tempb+=v[j];
		    	bo+=v[j];
		        // cout<<v[j]<<" ";
		    	j--;
		    	flag=1;
		    }
		    sum=tempb;
		    if(flag)
		     moves++;
	    }

	     cout<<moves<<" "<<al<<" "<<bo<<endl;
    }

  }
}


#include<bits/stdc++.h>

#define NN 1100

using namespace std;

typedef long long INT;

int s1[NN],a[NN],s2[NN];

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	int t;
	cin>>t;
	while(t--){
		memset(s1,0,sizeof s1);
		memset(s2,0,sizeof s2);
		int n;
		scanf("%d",&n);
		for(int i=1;i<=n;i++){
			scanf("%d",&a[i]);
			s1[i]=s1[i-1]+a[i];
		}
		for(int i=1;i<=n;i++)s2[i]=s1[n]-s1[n-i];

		int cnt=0,st=0,ed=n+1,pre=0,op=1,x=0,y=0;
		if(n==1){
			printf("1 %d 0\n",a[1]);
			continue;
		}
		while(st+1<ed){
			if(op==1){
				int id=upper_bound(s1+1,s1+n+1,s1[st]+pre)-s1;
				if(id>=ed){
					cnt++;
					x+=s1[ed-1]-s1[st];
					break;
				}
				pre=s1[id]-s1[st];
				op=2;
				st=id;
				cnt++;
				x+=pre;
				continue;
			}
			int id=upper_bound(s2+1,s2+n+1,s2[n+1-ed]+pre)-s2;
			id=n+1-id;
			if(id<=st){
				cnt++;
				y+=s1[ed-1]-s1[st];
				break;
			}
			pre=s1[ed-1]-s1[id-1];
			op=1;
			ed=id;
			y+=pre;
			cnt++;
		}
		printf("%d %d %d\n",cnt,x,y);
	}

	return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define NN 1111

int a[NN];

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	int T;
	cin >> T;

	while(T--) {
		int n; scanf("%d", &n);
		for(int i=1; i<=n; i++) scanf("%d", a+i);
		int s = 1;
		int prv = a[1];
		int L = 2, R = n;
		int st = 1;
		int A = a[1], B = 0;
		while(L<=R) {
			s++;
			if(st) {
				int sum = 0;
				while(R >= L and sum<=prv) sum += a[R], B += a[R], R--;
				prv = sum;
			} else {
				int sum = 0;
				while(R >= L and sum <= prv) sum += a[L], A += a[L], L++;
			}
			st ^= 1;
		}
		printf("%d %d %d\n", s, A, B);
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define NN 1010
int a[NN];
int s[NN];

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int T;
	scanf("%d",&T);
	while(T--){
		int n;
		scanf("%d",&n);
		for(int i=1;i<=n;i++) scanf("%d",&a[i]);
		for(int i=1;i<=n;i++) s[i]=s[i-1]+a[i];
		int st=1,ed=n,ok=1,val=0;
		int A=0,B=0,cnt=0;
		while(st<=ed){
			if(ok){
				int be=st-1,en=ed+1;
				while(be+1<en){
					int md=(be+en)>>1;
					if(s[md]-s[st-1]<=val) be=md;
					else en=md;
				}
				if(en>ed) en=ed;
				val=s[en]-s[st-1];
				st=en+1;
				A+=val;
			}
			else{
				int be=st-1,en=ed+1;
				while(be+1<en){
					int md=(be+en)>>1;
					if(s[ed]-s[md-1]>val) be=md;
					else en=md;
				}
				if(be<st) be=st;
				val=s[ed]-s[be-1];
				ed=be-1;
				B+=val;
			}
			cnt++;
			ok^=1;
		}
		printf("%d %d %d\n",cnt,A,B);
	}
    return 0;
}


#include<bits/stdc++.h>
#define x first
#define y second
#define pb push_back
using namespace std;
using DO = double;
using LL = long long;
using VI = vector<int>;
using pii = pair<int, int>;
const int mod = 1e9+7;
int power(int a, int b, int c=mod) {
  int ans=1;
  for(; b; b>>=1, a=(LL)a*a%c) {
    if(b&1) ans=(LL)ans*a%c;
  }
  return ans;
}

const int N = 2e3;
int d[N];

void solve() {
  int n;
  scanf("%d", &n);
  for(int i=1; i<=n; i++) {
    scanf("%d", d+i);
  }
  int a=0, b=0, pa=0, pb=0;
  int flag=0;
  int st=1, ed=n;
  int step=0;
  while(st<=ed) {
    step++;
    if(flag == 0) {
      int t=0;
      while(st<=ed && t<=pb) t+=d[st++];
      a+=t;
      pa=t;
      flag=1;
    }else {
      int t=0;
      while(st<=ed && t<=pa) t+=d[ed--];
      b+=t;
      pb=t;
      flag=0;
    }
  }
  printf("%d %d %d\n", step, a, b);
}

int main() {
#ifndef ONLINE_JUDGE
  freopen("D.in", "r", stdin);
  freopen("out.out", "w", stdout);
#endif
  int T;
  scanf("%d", &T);
  while(T--) solve();
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

int a[1010];

int main () {
#ifndef ONLINE_JUDGE
    freopen("in.in", "r", stdin);
#endif
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		for(int i=1;i<=n;i++)scanf("%d",a+i);
		int ans=1,st=2,ed=n,ans1=a[1],ans2=0,last=a[1];
		while(st<=ed){
			ans++;
			int tmp=0;
			if(ans&1){
				while(tmp<=last && st<=ed)tmp+=a[st++];
				ans1+=tmp;
				last=tmp;
			}
			else {
				while(tmp<=last && st<=ed)tmp+=a[ed--];
				ans2+=tmp;
				last=tmp;
			}
		}
		cout<<ans<<" "<<ans1<<" "<<ans2<<endl;
	}
}


#include <bits/stdc++.h>
#define x first
#define y second
#define NN 1010
using namespace std;

int a[NN];

typedef long long INT;
typedef pair<int, int> pii;

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int test;
	scanf("%d", &test);
	while(test--){
		int n;
		scanf("%d", &n);
		int sum = 0;
		for(int i = 1; i <= n; i++) scanf("%d", &a[i]), sum += a[i];
		int cnt1 = 0, cnt2 = 0;
		int tmp1 = 0, tmp2 = 0;
		int st = 1, ed = n;
		int ct = 0;
		int ctt = 0;
		int flag = 1;
		while(1){
			ctt++;
			int ct = 0;
			if(flag){
				int fl = 1;
				for(int i = st; i <= ed; i++) {
					ct += a[i];
					if(ct > tmp2) {
						st = i + 1;
						fl = 0;
						break;
					}
				}
				if(ct== 0) ctt--;
				if(fl) {printf("%d %d %d\n", ctt, sum - cnt2, cnt2); break;}
				else {
					tmp1 = ct;
					cnt1 += ct;
				}
			}
			else{
				int fl = 1;
				for(int i = ed; i >= st; i--) {
					ct += a[i];
					if(ct > tmp1) {
						ed = i - 1;
						fl = 0;
						break;
					}
				}
				if(ct == 0) ctt--;
				if(fl) {printf("%d %d %d\n", ctt, cnt1, sum - cnt1); break;}
				else {
					tmp2 = ct;
					cnt2 += ct;
				}
			}
			flag = 1 - flag;
		}

	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define NN 1111

int a[NN];

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	int T;
	cin >> T;

	while(T--) {
		int n; scanf("%d", &n);
		for(int i=1; i<=n; i++) scanf("%d", a+i);
		int s = 1;
		int prv = a[1];
		int L = 2, R = n;
		int st = 1;
		int A = a[1], B = 0;
		while(L<=R) {
			s++;
			if(st) {
				int sum = 0;
				while(R >= L and sum<=prv) sum += a[R], B += a[R], R--;
				prv = sum;
			} else {
				int sum = 0;
				while(R >= L and sum <= prv) sum += a[L], A += a[L], L++;
				prv = sum;
			}
			st ^= 1;
		}
		printf("%d %d %d\n", s, A, B);
	}

	return 0;
}


#include<bits/stdc++.h>
#define lli long long int
using namespace std;
bool checkzero(int a[],int n)
{
    for(int i=0;i<n;i++)
    {
        if(a[i]!=0)return false;
    }
    return true;
}
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n,i,j,move=0,aliceSum=0,bobSum=0,alice=0,bob=0,count=0;
        cin>>n;
        int a[n];
        for(i=0;i<n;i++)cin>>a[i];
        for(i=0,j=n-1,count=0;i<n;)
        {
            alice=0;
            if(i<n){
            do{
                alice+=a[i];
                a[i]=0;
                ++i;
            }while(alice<=bob&&i<n);
            if(alice!=0)move++;
            aliceSum+=alice;}
            if(checkzero(a,n))break;
            bob=0;
            if(j>=0){
            do{
                bob+=a[j];
                a[j]=0;
                --j;
            }while(bob<=alice &&j>=0);
            if(bob!=0)move++;
            bobSum+=bob;}
            if(checkzero(a,n))break;
        }
        cout<<move<<" "<<aliceSum<<" "<<bobSum<<"\n";

    }
}


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

#define ll long long int
#define pb push_back
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pp pop_back

int main()
{
    fio
    ll t;
    cin>>t;
    while(t--)
    {
        ll n,alice=0,bob=0,move=0,p,alicesum=0,bobsum=0,k=-1;
        cin>>n;
        p=n;
        ll a[n];
        bool f=0;
        for(ll i=0;i<n;i++)
        cin>>a[i];
        ll low=0,high=n;
        while(low<high)
        {
            if(f)
            {
            if(bob<=alice)
                {
                    for(ll j=p-1;j>k;j--)
                    {
                    if(abs(high-low)==1)
                    {
                    bob+=a[j];
                    high--;
                    break;
                    }
                    high--;
                    bob+=a[j];
                    if(bob>alice)
                    {
                    f=0;
                    p=j;
                    break;
                    }
                    }
                bobsum+=bob;
               // cout<<"bobsum"<<bobsum<<endl;
                alice=0;
                }
                move++;

            }
            else
            {
                if(alice<=bob)
                {
                    for(ll i=k+1;i<n;i++)
                    {
                        if(abs(high-low)==1)
                        {
                            alice+=a[i];
                            low++;
                            break;
                        }
                        low++;
                        alice+=a[i];
                        if(alice>bob)
                        {
                            k=i;
                            f=1;
                            break;
                        }
                    }
                alicesum+=alice;
                //cout<<"alicesum"<<alicesum<<endl;
                bob=0;
                }
                move++;
            }
        }
        cout<<move<<" "<<alicesum<<" "<<bobsum;
        cout<<"\n";
    }
}


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

#define ll long long int
#define pb push_back
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pp pop_back

int main()
{
    fio
    ll t;
    cin>>t;
    while(t--)
    {
        ll n,alice=0,bob=0,move=0,p,alicesum=0,bobsum=0,k=-1;
        cin>>n;
        p=n;
        ll a[n];
        bool f=0;
        for(ll i=0;i<n;i++)
        cin>>a[i];
        ll low=0,high=n;
        while(low<high)
        {
            if(f)
            {
            if(bob<=alice)
                {
                    for(ll j=p-1;j>k;j--)
                    {
                    if(abs(high-low)==1)
                    {
                    bob+=a[j];
                    high--;
                    break;
                    }
                    high--;
                    bob+=a[j];
                    if(bob>alice)
                    {
                    f=0;
                    p=j;
                    break;
                    }
                    }
                bobsum+=bob;
                cout<<"bobsum"<<bobsum<<endl;
                alice=0;
                }
                move++;

            }
            else
            {
                if(alice<=bob)
                {
                    for(ll i=k+1;i<n;i++)
                    {
                        if(abs(high-low)==1)
                        {
                            alice+=a[i];
                            low++;
                            break;
                        }
                        low++;
                        alice+=a[i];
                        if(alice>bob)
                        {
                            k=i;
                            f=1;
                            break;
                        }
                    }
                alicesum+=alice;
                cout<<"alicesum"<<alicesum<<endl;
                bob=0;
                }
                move++;
            }
        }
        cout<<move<<" "<<alicesum<<" "<<bobsum;
        cout<<"\n";
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, a[200000];
void solve(){
      cin >> n;
      for(int i=0;i<n;i++) cin >> a[i];
      int move = 0, sum1 = 0,sum2 = 0;
      int i=0,j = n-1;
      ll x = 0,y=0;
      if(n == 1) cout << 1 << " " << a[0] << " " << 0 << endl;
      else{
            while(i <= j){
            x = 0;
            if(i<=j) move++;
            while(x <= y and i<=j){
                  x += a[i];
                  i++;
            }
            sum1 += x;
            y = 0;
            if(i<=j) move++;
            while(y <= x and i<=j){
                  y += a[j];
                  j--;
            }
            sum2 += y;
      }
      cout << move << " " << sum1 << " " << sum2 << endl;
      }
}

int main()
{
      int t; cin >> t;
      while(t--)
            solve();
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, a[200000];
void solve(){
      cin >> n;
      for(int i=0;i<n;i++) cin >> a[i];
      int move = 0, sum1 = 0,sum2 = 0;
      int i=0,j = n-1;
      ll x = 0,y=0;
      if(n == 1) cout << 1 << " " << a[0] << " " << 0 << endl;
      else{
            while(i < j){
            x = 0;
            while(x <= y and i<=j){
                  x += a[i];
                  i++;
            }
            sum1 += x;
            move++;
            y = 0;
            while(y <= x and i<=j){
                  y += a[j];
                  j--;
            }
            sum2 += y;
            move++;
      }
      cout << move << " " << sum1 << " " << sum2 << endl;
      }
}

int main()
{
      int t; cin >> t;
      while(t--)
            solve();
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, a[200000];
void solve(){
      cin >> n;
      for(int i=0;i<n;i++) cin >> a[i];
      int move = 0, sum1 = 0,sum2 = 0;
      int i=0,j = n-1;
      ll x = 0,y=0;
      if(n == 1) cout << 1 << " " << a[0] << " " << 0 << endl;
      else{
            while(i < j){
            x = 0;
            while(x <= y and i<=j){
                  x += a[i];
                  i++;
            }
            sum1 += x;
            y = 0;
            while(y <= x and i<=j){
                  y += a[j];
                  j--;
            }
            sum2 += y;
            move+= 2;
      }
      cout << move << " " << sum1 << " " << sum2 << endl;
      }
}

int main()
{
      int t; cin >> t;
      while(t--)
            solve();
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, a[200000];
int solve(){
      cin >> n;
      for(int i=0;i<n;i++) cin >> a[i];
      int move = 0, sum1 = 0,sum2 = 0;
      int i=0,j = n-1;
      ll x = 0,y=0;
      if(n == 1) cout << 1 << " " << a[0] << " " << 0 << endl;
      else{
            while(i < j){
            x = 0;
            while(x <= y and i<=j){
                  x += a[i];
                  i++;
            }
            sum1 += x;
            move++;
            y = 0;
            while(y <= x and i<=j){
                  y += a[j];
                  j--;
            }
            sum2 += y;
            move++;
      }
      cout << move << " " << sum1 << " " << sum2 << endl;
      }
}

int main()
{
      int t; cin >> t;
      while(t--)
            solve();
}