#include <bits/stdc++.h>
 
using namespace std;
 
#define int long long
#define all(x) (x).begin(),(x).end()
#define ll long long
#define ld long double

void solve() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (auto& i : a) {
        cin >> i;
    }
    sort(all(a));
    vector<int> b(n);
    b[0] = a[0];
    for (int i = 1; i < n; ++i) {
        b[i] = b[i - 1] + a[i];
    }
    int res = -a.back();
    for (int i = 1; i < n; ++i) {
        res += i * a[i] - b[i - 1];
    }
    cout << -res << endl;
}  
 
signed main() {
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
        cout << fixed << setprecision(8);
    #else
        cout << fixed << setprecision(15);
    #endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1;

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