#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
typedef long long ll;

void solve()
{
	int n;
	cin >> n;
	vector<ll> v(n);
	ll s = 0;
	ll mx = 0;
	for (int i = 0; i < n; i++)
	{
		cin >> v[i];
		s += v[i];
		mx = max(mx, v[i]);
	}

	cout << (n - 1) * max(mx, (s + (n - 2)) / (n - 1)) - s << '\n';
}

int main()
{
	int t;
	cin >> t;
	while(t--)
		solve();
	return 0;
}