#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <unordered_set>
#include <set>
#include <unordered_map>
#include <iomanip>
#include <random>
//#include <fstream>
/*#include <cstdio>
#include <ctime>*/

using namespace std;

void solve()
{
	int n;
	cin >> n;
	vector<long long> a(n);
	long long sum = 0, maX = -1;
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
		sum += a[i];
		maX = max(maX, a[i]);
	}
	//If nephew does not choose a box other than maximum
		//We want to have all boxes equal to the maximum
	//Also since we will distribute all toys equally in the end
		//We want the new sum to be divisible by n -1
		//Therefore we need to add ceil(sum/n-1) * (n-1) - sum
	cout << max(maX, (sum + n-2)/(n-1)) * (n - 1) - sum << endl;
}
int main() {
	int t = 1;
	cin >> t;
	while (t--)
		solve();
	return 0;
}