//g++  7.4.0

#include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    ll T; cin>>T;
    while(T--)
    {
        ll N; cin>>N;
        ll arr[N];
        ll sum = 0;
        ll mx = 0;
        for(ll i=0;i<N;++i)
        {
            cin>>arr[i];
            mx = max(mx,arr[i]);
            sum += arr[i];
        }
        
        ll cur = (sum + N - 2)/(N - 1);
        cur = max(cur,mx);
        
        ll k = (N - 1) * cur - sum;
        
        cout<<k<<endl;
    }
}