#include <bits/stdc++.h>
#define int long long
#define mp make_pair
#define pb push_back
#define ld long double
#define pii pair<int,int>
#define sz(x) (int)x.size()
#define piii pair<pii,pii>
#define precise cout<<fixed<<setprecision(10)
#define st first
#define nd second
#define ins insert
#define vi vector<int>
#define BOOST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;
const int MAX=1e5+5;
int a[MAX];
void solve(){
	int n;
	cin>>n;
	for (int i=1;i<=n;i++)cin>>a[i];
	sort(a+1,a+n+1);
	int ans=a[n];
	int sum=0;
	for (int i=1;i<=n;i++){
		ans-=a[i]*(i-1)-sum;
		sum+=a[i];
	}
	cout<<ans<<"\n";
}
int32_t main(){
  BOOST;
  int t;
  cin>>t;
  for (int z=0;z<t;z++){
		solve();
  }
  return 0; 
}

