#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
       ll n;
       cin>>n;
       ll a[n];
       ll i;
       ll sum=0;
       ll max=INT_MIN;
       for(i=0;i<n;i++)
       {
           cin>>a[i];
           if(a[i]>max)
           {
               max=a[i];
           }
           sum+=a[i];
       }
       ll d=max*(n-1);
       if(d>=sum)
       {
           ll ans=d-sum;
           cout<<ans<<endl;
       }
       else
       {
           double s=sum;
           ll k=ceil(s/(n-1));
           ll p=k*(n-1);
           ll ans=p-sum;
           cout<<ans<<endl;
       }
       
       
       
       
    }
}