#include<bits/stdc++.h>
using namespace std;
#define int               long long int
#define pb                push_back
#define ppb               pop_back
#define pf                push_front
#define ppf               pop_front
#define all(x)            (x).begin(),(x).end()
#define uniq(v)           (v).erase(unique(all(v)),(v).end())
#define sz(x)             (int)((x).size())
#define fr                first
#define sc                second
#define pii               pair<int,int>
#define rep(i,a,b)        for(int i=a;i<b;i++)
#define mem1(a)           memset(a,-1,sizeof(a))
#define mem0(a)           memset(a,0,sizeof(a))
#define ppc               __builtin_popcount
#define ppcll             __builtin_popcountll

template<typename T1,typename T2>istream& operator>>(istream& in,pair<T1,T2> &a){in>>a.fr>>a.sc;return in;}
template<typename T1,typename T2>ostream& operator<<(ostream& out,pair<T1,T2> a){out<<a.fr<<" "<<a.sc;return out;}
template<typename T,typename T1>T amax(T &a,T1 b){if(b>a)a=b;return a;}
template<typename T,typename T1>T amin(T &a,T1 b){if(b<a)a=b;return a;}
const int N5=1e5+7,N5_2=2e5+7,N5_3=3e5+7,N6=1e6+7,N7=1e7+7,mod=998244353;
// int prime[N6];
 
 
bool comp(pair<int,int> a, pair<int,int> b){
    return a.second<b.second?1:0;
}
 
int pw(int n, int p,int M=mod){
    int val=1;
    while(p>0){
        if(p & 1){
            val= (val*n)%M;
        }
        n=(n*n)%M;
        p>>=1;
    }
    return val;
}
 
// void SieveofEratosthenes(int n=N6){
//     memset(prime,true, sizeof(prime));
//     rep(i,2,n+1){
//         if(prime[i]){
//             for(int j=i*i;j<=n;j+=i){
//                 prime[j]=false;
//             }
//         }
//     }
//     return;
// }
 
/* 
3
01101?1
12345678
1467
47
7
01101??

0211111

0000000

6
5 1
6 ?
7 ?
1 ?
5 ?
1 1

x 2x 3x .... nx : t+x, 2x+t

px+t>nx
p-n>-t/x
p>n-t/x



*/


void solve(){
    int n;
    cin>>n;
    int d[N5_2];
    rep(i,0,n)  cin>>d[i];
    sort(d,d+n);
    int pre[N5_2]={0}; 
    rep(i,1,n){
        pre[i]=pre[i-1]+d[i];
    }
    int cost=d[n-1];
    for(int i=n-1;i>0;i--){
        cost-=i*d[i]-pre[i-1];
    }
    cout<<cost<<endl;
    return;

}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    #endif
    #ifdef SIEVE
        sieve();
    #endif
    #ifdef NCR
        init();
    #endif
    int t=1;
    cin>>t;
    while(t--) solve();
    return 0;
}