#include <bits/stdc++.h>

#define ll long long
#define ii pair<ll, ll>
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define pi acos(-1.0)
#define oo 1000000007
#define loo 0x7fffffffffffffff


#define prime 1000000007
ll mod = prime;
ll powmod(ll a,ll b) {ll res=1;a%=mod;assert(b>=0);for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}

#define W(x) cerr << "\033[31m" << #x << " = " << x << "\033[0m" << "\n";
using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int t; cin >> t;
    while(t--){
        ll n; cin >> n;
        vl v(n);
        ll sum = 0, ma = 0;
        for (int i = 0; i < n; ++i){
            cin >> v[i];
            sum+=v[i];
            ma = max(ma, v[i]);
        }
        ll aux = ma*(n-1);
        ll tmp = (n-1-sum%(n-1))%(n-1);
        if(sum+tmp >= aux){
            cout << tmp << "\n";
        }else cout << aux-sum << "\n";
    }
    
    return 0;
}