#include <bits/stdc++.h>

#define int long long

using namespace std;



int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int T;
    cin >> T;

    while(T--)
    {
    	int N;
    	cin >> N;

    	int sum = 0;

    	int may = 0;

    	for(int i = 0 ; i < N ; i++)
    	{
    		int n;
    		cin >> n;
    		sum += n;
    		may = max(may, n);
    	}

    	int temp = max(sum, may*(N-1));

    	int val = ((N-1) - temp%(N-1)) % (N-1);

    	temp += val;

    	cout << temp-sum << '\n';
    }

    return 0;
}