#include using namespace std; #define ALL(x) (x).begin(), (x).end() #define REP(i, n) for(ll i=0; i<(ll)(n); i++) int lob(const auto& v, auto x) { return lower_bound(ALL(v),x)-v.begin(); } bool chmax(auto& a, auto b) { return ab ? a=b, true : false; } using ll=long long; const int INF=1e9+10; const ll INFL=4e18; using VI=vector; using VVI=vector; using VL=vector; using VVL=vector; using PL=pair; using VP=vector; using WG=vector>>; #ifdef LOCAL #include "./debug.hpp" #else #define debug(...) #define print_line #endif //---------------------------------------------------------- void solve() { ll N; cin>>N; VL A(N); REP(i,N) cin>>A[i]; sort(ALL(A)); reverse(ALL(A)); debug(A); if(A[0]<0) { ll a=A[N-1], b=A[N-2]; cout<<-2*reduce(ALL(A))+a+b<>T; while(T--) solve(); }