#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back



void solve() {
    ll n, sum = 0;
    cin >> n;
    vector<ll>v(n);
    for (int i = 0; i < n; i++) {
        cin >> v[i];
        sum += v[i];
    }
    ll mx = *max_element(v.begin(), v.end());
    ll mx2 = ceil(1.0 * sum / (n - 1));
    ll k = max(mx, mx2);
    cout << k*(n - 1) - sum << "\n";
}


int main() {
    ll t = 1;
    cin >> t;
    while (t--)
        solve();

    return 0;
}