/*input

*/
#include <bits/stdc++.h>
#define up(i,a,b) for(int (i) = (a);(i)<=(b);++(i))
#define down(i,b,a) for(int (i) = (b);i>=(a);--i)
#define bits(x,i) (((x) >> (i)) & 1)
#define mid ((l+r)/2)
#define pr pair<int,int>
#define int long long
using namespace std;
const int N = 100005;
int a[N],n,t;
signed main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	cin >> t;
	while (t--){
		cin >> n;
		long long sum = 0;
		up(i,1,n) cin >> a[i], sum += a[i];
		sort(a+1,a+1+n);
		int x = max(sum/(n-1) + (sum % (n - 1) != 0),a[n]);
		cout << 1LL*x*(n-1) - sum << '\n';
	}
}