Language: C++

#include <bits/stdc++.h>
using namespace std;
const int maxn=200005;
ll sum[maxn],a[maxn];
ll n,b,c,d,e;
ll ans=1e15+7;
bool check(ll x,ll y,int i)
{
    if(abs((x+a[i])-(y-a[i]))<abs(x-y))
    return 1;
    return 0;
}
int main()
{
    cin>>n;
    ll s=0;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        s+=a[i];
        sum[i]=s;
    }
    int j=0,k=2;
    for(int i=1;i<n-2;i++)
    {
        b=sum[j];
        c=sum[i]-sum[j];
        d=sum[k]-sum[i];
        e=sum[n-1]-sum[k];
        while(check(b,c,j+1) && j+1<i)
        {
            j++;
            b=sum[j];
            c=sum[i]-sum[j];
        }
        while(check(d,e,k+1) && k+1<n-1)
        {
            k++;
            d=sum[k]-sum[i];
            e=sum[n-1]-sum[k];
        }
        ll test[10];
        test[0]=b;test[1]=c;
        test[2]=d;test[3]=e;
        sort(test,test+4);
        ans=min(ans,test[3]-test[0]);
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc:4:1: error: 'll' does not name a type
    4 | ll sum[maxn],a[maxn];
      | ^~
a.cc:5:1: error: 'll' does not name a type
    5 | ll n,b,c,d,e;
      | ^~
a.cc:6:1: error: 'll' does not name a type
    6 | ll ans=1e15+7;
      | ^~
a.cc:7:12: error: 'll' was not declared in this scope
    7 | bool check(ll x,ll y,int i)
      |            ^~
a.cc:7:17: error: 'll' was not declared in this scope
    7 | bool check(ll x,ll y,int i)
      |                 ^~
a.cc:7:22: error: expected primary-expression before 'int'
    7 | bool check(ll x,ll y,int i)
      |                      ^~~
a.cc:7:27: error: expression list treated as compound expression in initializer [-fpermissive]
    7 | bool check(ll x,ll y,int i)
      |                           ^
a.cc: In function 'int main()':
a.cc:15:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   15 |     cin>>n;
      |          ^
      |          yn
a.cc:16:5: error: 'll' was not declared in this scope
   16 |     ll s=0;
      |     ^~
a.cc:19:14: error: 'a' was not declared in this scope
   19 |         cin>>a[i];
      |              ^
a.cc:20:9: error: 's' was not declared in this scope
   20 |         s+=a[i];
      |         ^
a.cc:21:9: error: 'sum' was not declared in this scope
   21 |         sum[i]=s;
      |         ^~~
a.cc:26:9: error: 'b' was not declared in this scope
   26 |         b=sum[j];
      |         ^
a.cc:26:11: error: 'sum' was not declared in this scope
   26 |         b=sum[j];
      |           ^~~
a.cc:27:9: error: 'c' was not declared in this scope
   27 |         c=sum[i]-sum[j];
      |         ^
a.cc:28:9: error: 'd' was not declared in this scope
   28 |         d=sum[k]-sum[i];
      |         ^
a.cc:29:9: error: 'e' was not declared in this scope
   29 |         e=sum[n-1]-sum[k];
      |         ^
a.cc:30:20: error: 'check' cannot be used as a function
   30 |         while(check(b,c,j+1) && j+1<i)
      |               ~~~~~^~~~~~~~~
a.cc:36:20: error: 'check' cannot be used as a function
   36 |         while(check(d,e,k+1) && k+1<n-1)
      |               ~~~~~^~~~~~~~~
a.cc:42:11: error: expected ';' before 'test'
   42 |         ll test[10];
      |           ^~~~~
      |           ;
a.cc:43:9: error: 'test' was not declared in this scope
   43 |         test[0]=b;test[1]=c;
      |         ^~~~
a.cc:46:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   46 |         ans=min(ans,test[3]-test[0]);
      |         ^~~
      |         abs
a.cc:48:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   48 |     cout<<ans<<endl;
      |           ^~~
      |           abs