#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<queue>
#include<map>
#include<stack>
#include<string>
#include<cstdio>
using namespace std;        
typedef long long ll;
ll a[100005];


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int t;cin>>t;
	while(t--)
	{
		int n;cin>>n;
		ll ans=0;
		for(int i=1;i<=n;i++)
		cin>>a[i],ans+=a[i];
		sort(a+1,a+1+n);
		if(ans%(n-1)==0) {
			if(a[n]<=ans/(n-1)) cout<<0<<endl;
			else cout<<a[n]*(n-1)-ans<<endl;
		}
		else {
			cout<<max(a[n],ans/(n-1)+1)*(n-1)-ans<<endl;
		}
	}    
    
	return 0;	  
}

