#include <bits/stdc++.h>

using namespace std;

void solve() {
    
    int n;
    
    cin >> n;
    
    long long arr[n], sum = 0;
    
    for(int i = 0; i<n; i++) cin >> arr[i];
    
    sort(arr, arr+n);
    
    long long ans = 0;
    
    for(int i = 0; i<n; i++) {
        ans+=((i*arr[i]) - (n-1-i)*arr[i]);
    }
    
    cout << arr[n-1]-ans;
}

int main() {
    
    int t;
    
    cin >> t;
    
    while(t--) solve(), cout << "\n";
    
    return 0;
}