Language: C++

#include<bits/stdc++.h>

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;A++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

/////////////////////////////////////////////////////
#define INF 1e15
ll N, A[101010];
ll Asum[101010];
ll ans[101010],ans2;
ll i, j, k,l;


int main(){
    scanf("%lld", &N);
    fornum(i,0,N){
        scanf("%lld", &A[i]);
    }
    sort(A, A + N);
    ans2 -= A[0];
    fornum(i,1,N-1){
        if(A[i]>0){
            ans2 += A[i];
        }else{
            ans2 -= A[i];
        }
    }
    ans2 += A[N - 1];
    printf("%lld\n", ans2);
    /*
    if(A[N-1]<0){
        j = A[N - 1];
        fornum(i,0,N-1){
        printf("%lld %lld\n", j, A[i]);
            j = j - A[i];
        }
    }
    else{*/
        j = A[0];
        ll flg = 0;
        fornum(i,0,N-1){
        if(i<N-2&&A[N-2-i]>0||flg){
            printf("%lld %lld\n", j, A[N - 1 - i]);
            j = j - A[N - 1 - i];
        }else{
            printf("%lld %lld\n", A[N - 1 - i], j);
            j = A[N - 1 - i] - j;
            flg = 1;
        }
    }
    //}
    
    
    return 0;
}#include<bits/stdc++.h>

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;A++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

/////////////////////////////////////////////////////
#define INF 1e15
ll N, A[101010];
ll Asum[101010];
ll ans[101010],ans2;
ll i, j, k,l;


int main(){
    scanf("%lld", &N);
    fornum(i,0,N){
        scanf("%lld", &A[i]);
    }
    sort(A, A + N);
    ans2 -= A[0];
    fornum(i,1,N-1){
        if(A[i]>0){
            ans2 += A[i];
        }else{
            ans2 -= A[i];
        }
    }
    ans2 += A[N - 1];
    printf("%lld\n", ans2);
    /*
    if(A[N-1]<0){
        j = A[N - 1];
        fornum(i,0,N-1){
        printf("%lld %lld\n", j, A[i]);
            j = j - A[i];
        }
    }
    else{*/
        j = A[0];
        ll flg = 0;
        fornum(i,0,N-1){
        if(i<N-2&&A[N-2-i]>0||flg){
            printf("%lld %lld\n", j, A[N - 1 - i]);
            j = j - A[N - 1 - i];
        }else{
            printf("%lld %lld\n", A[N - 1 - i], j);
            j = A[N - 1 - i] - j;
            flg = 1;
        }
    }
    //}
    
    
    return 0;
}

Compiler output:
a.cc:60:2: error: stray '#' in program
   60 | }#include<bits/stdc++.h>
      |  ^
a.cc:60:3: error: 'include' does not name a type
   60 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:72:4: error: redefinition of 'long long int N'
   72 | ll N, A[101010];
      |    ^
a.cc:13:4: note: 'long long int N' previously declared here
   13 | ll N, A[101010];
      |    ^
a.cc:72:7: error: redefinition of 'long long int A [101010]'
   72 | ll N, A[101010];
      |       ^
a.cc:13:7: note: 'long long int A [101010]' previously declared here
   13 | ll N, A[101010];
      |       ^
a.cc:73:4: error: redefinition of 'long long int Asum [101010]'
   73 | ll Asum[101010];
      |    ^~~~
a.cc:14:4: note: 'long long int Asum [101010]' previously declared here
   14 | ll Asum[101010];
      |    ^~~~
a.cc:74:4: error: redefinition of 'long long int ans [101010]'
   74 | ll ans[101010],ans2;
      |    ^~~
a.cc:15:4: note: 'long long int ans [101010]' previously declared here
   15 | ll ans[101010],ans2;
      |    ^~~
a.cc:74:16: error: redefinition of 'long long int ans2'
   74 | ll ans[101010],ans2;
      |                ^~~~
a.cc:15:16: note: 'long long int ans2' previously declared here
   15 | ll ans[101010],ans2;
      |                ^~~~
a.cc:75:4: error: redefinition of 'long long int i'
   75 | ll i, j, k,l;
      |    ^
a.cc:16:4: note: 'long long int i' previously declared here
   16 | ll i, j, k,l;
      |    ^
a.cc:75:7: error: redefinition of 'long long int j'
   75 | ll i, j, k,l;
      |       ^
a.cc:16:7: note: 'long long int j' previously declared here
   16 | ll i, j, k,l;
      |       ^
a.cc:75:10: error: redefinition of 'long long int k'
   75 | ll i, j, k,l;
      |          ^
a.cc:16:10: note: 'long long int k' previously declared here
   16 | ll i, j, k,l;
      |          ^
a.cc:75:12: error: redefinition of 'long long int l'
   75 | ll i, j, k,l;
      |            ^
a.cc:16:12: note: 'long long int l' previously declared here
   16 | ll i, j, k,l;
      |            ^
a.cc:78:5: error: redefinition of 'int main()'
   78 | int main(){
      |     ^~~~
a.cc:19:5: note: 'int main()' previously defined here
   19 | int main(){
      |     ^~~~