#include<iostream>
#include<vector>
#include<queue>
#include<stack>
#include<unordered_map>
#include<map>
#include<set>
#include<unordered_set>
#include<algorithm>
#include<list>
#include<bitset>
#include<utility>
#include<climits>
#include<deque>
#include<math.h>
#include<stdio.h>
#define INF  (int)1e9
#define MOD 1000000007ll
#define all(x) x.begin(), x.end()
#define sortall(x) sort(all(x))
#define ll long long
#define pii pair<int,int>
#define pb push_back
#define ppb pop_back
#define uset unordered_set
#define umap unordered_map

using namespace std;
void solve(){
	int n;
	cin>>n;
	ll a[n],sum=0;
	for(int i=0;i<n;i++)
		cin>>a[i],sum+=a[i];
		
	ll maxi=*max_element(a,a+n);
	ll temp=ceil(sum*1.0/(n-1));
	ll temp1=temp*(n-1);
	if(maxi>temp)
		temp1=maxi*(n-1);
	
	cout<<temp1-sum<<endl;	
	
		
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int t=1;
	cin>>t;
	while(t--){
	solve();
	}
}

