#include <bits/stdc++.h> 
using namespace std;

using ll = long long;
using ld = long double;
#define fi first
#define se second

void solve(){
	ll n;
	cin>>n;
	vector<ll>d(n);
	for(int i=0;i<n;i++)
		cin>>d[i];
	ll ans=0,curr=0;
	sort(d.begin(),d.end());
	for(int i=1;i<d.size()-1;i++){
		ans+=(i*d[i])-curr;
		curr+=d[i];
	}
	ll l = d.size();
	if(l>=3)
		ans+=((l-2)*d[l-1])-curr;
	cout<<-1*ans<<"\n";
}

int main() 
{ 
	ios::sync_with_stdio(false);
	cin.tie(0);

	int t;
	cin>>t;
	while(t--){
		solve();
	}	

	return 0; 
}

