#include<bits/stdc++.h>
#define ll long long
using namespace std;
// Recursive function to return gcd of a and b 
int gcd(int a, int b) 
{ 
    if (a == 0) 
        return b; 
    else{
    return gcd(b%a, a);  
      }
} 
int main(){
	int t;
	cin>>t;
	while(t--){
		ll n;
		cin>>n;
		ll a[n];
		ll sum=0;
		ll max=INT_MIN;
		for(int i=0;i<n;i++){
			cin>>a[i];
			if(a[i]>max){
				max=a[i];
			}
			sum+=a[i];
		}
		ll ans= ceil(float(sum)/(n-1));
		if(max>ans){
			cout<<max*(n-1)-sum<<endl;
			continue;
		}
		ans=(ans*(n-1))-sum;
		cout<<ans<<endl;
  }
	return 0;
}