#include <bits/stdc++.h>
using namespace std;
#define ll long long
int t,n;
int temp;
long long sum;


ll a[200005];

int main(){
//solve();
    int t;
    cin>>t;
    while(t--)
    {
    	ll Max,sum;
    	int n;
    	cin>>n;
    	Max = 0;
    	sum = 0;
    	for(int i=0;i<n;i++)
    	{
    		cin>>a[i];
    		sum+=a[i];
    		Max = max(a[i],Max);
		}
		//cout<<sum<<endl;
		if(sum>=Max*(n-1))
		{
			if(sum%(n-1)==0)
			{
				cout<<"0"<<endl;
			}
			else cout<<n-1-(sum%(n-1))<<endl; 
		}
		else{
            cout << (n-1)*Max-sum<<endl;
        }
	}
	

	return 0; 
}