#include <iostream>
#include<math.h>
using namespace std;

//Compiler version g++ 6.3.0

int main()
{
  long long max =0,sum=0;
  long long temp;
  long long n;
  long long t;
  cin>>t;
  while(t--)
  {
     cin>>n;
     sum=0;
     max =0;
     for(int i=0;i<n;i++){
       cin>>temp;
       sum+=temp;
       if(temp>=max) max = temp;
     }
     long long c1 = (n-1)*max - sum;
     long long c2 = (n - 1 - sum % (n-1))%(n-1);
     cout<<(c1>c2?c1:c2)<<endl;
  }
}