#include <iostream>
#include <vector>

using namespace std;
typedef long long ll;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int T; cin >> T;
	while(T-->0)
	{
		ll n; cin >> n;
		ll sum = 0;
		ll maximum = 0;
		for(int i = 0; i < n; i++)
		{
			ll x; cin >> x;
			sum += x;
			maximum = max(maximum, x);
		}
		ll y = (n-1)*maximum;
		ll ans;
		if(sum > y)
		{
			ans = ((n-1) - (sum % (n-1))) % (n-1);
		}
		else // y >= sum
		{
			ans = y - sum;
		}
		cout << ans << endl;
	}
	return 0;
}
