#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define REPO(i,x) for(int i=x-1;i>=0;i--)
#define ull unsigned long long int
#define pii pair<int, int>
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define ROF(i,a,b) for(int i=a;i>=b;i--)
#define pll pair<long long int, long long int>
#define T int  tc; cin>>tc;while(tc--)
#define READ   freopen("input.txt","r", stdin)
#define WRITE(x) freopen (x,"w",stdout)
#define SORT(v) sort(v.begin(),v.end())
#define REV(v) reverse(v.begin(),v.end())
#define mem(a,b)     memset(a, b, sizeof(a))
#define lcm(a, b) ((a / __gcd(a, b) ) * b)
#define scanI(a) scanf("%d",&a)
#define scanI2(a,b) scanI(a) , scanI(b)
#define pf(a) printf("%d\n", a);
#define pfl(a) printf("%lld\n", a);
#define PI 2*acos(0.0)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define ll long long
#define MAX 100005
#define inf 1e18
#define MOD 1000000007
#define n0  cout<<"\n"
#define base 31
//int dx[4]={0,0,1,-1};
//int dy[4]={1,-1,0,0};
//ull has[1000001];
//ull has1[1000001],po[1000001];
//ull gethas(int L, int R)
//{   return (has[R] - (has[L - 1] * po[R - L + 1]));}
int main()
{
   T{
   ll n; cin>>n; ll ar[n]; for(ll i=0;i<n;i++) cin>>ar[i]; ll s=0; ll c=0,c1=n-1; sort(ar,ar+n);
   for(ll i=n-1;i>=0;i--)
   {
       s+=ar[i]*(c1-c); c1--; c++;
   } ll s1=s-(ll)ar[n-1];
    s1*=-1;cout<<s1<<endl;}}



