#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
typedef long long LL;
int main()
{
	int T, n;
	LL sum;
	int maxa;
	scanf("%d", &T);
	while(T)
	{
		T--;
		scanf("%d", &n);
		sum = 0;
		maxa = 0;
		for(int i = 1; i <= n; i++)
		{
			int x;
			scanf("%d", &x);
			sum += x;
			maxa = max(maxa, x);
		}
		if((n - 1) * (LL) maxa - sum <= 0)
			cout << (n - 1 - sum % (n - 1)) % (n - 1) << endl;
		else
			cout << (LL)(n - 1) * (LL) maxa - sum << endl;
	}
	return 0;
 } 