#include <bits/stdc++.h>

using namespace std;

int main(){
    int t;
    cin >> t;
    while(t--){
        int n;
        cin >> n;
        vector<long long> a(n);
        long long sum = 0;
        for(int i = 0; i < n; i++){

            cin >> a[i];
            sum += a[i];
        }

        sort(a.begin(), a.end());
        if(sum == 0) cout<<0<<"\n";
        else{
            long long mx = a[a.size() - 1];
            if(sum > mx*(n-1)) mx = (sum/(n-1)) + (sum % (n-1) != 0);
            if(mx*(n-1) < sum) mx++;
            long long s = (n - 1)*mx;
            cout<<s - sum<<"\n";
        }
    }
}
