#pragma GCC optimize(2)
#include <bits/stdc++.h>
#define all(n) (n).begin(), (n).end()
#define se second
#define fi first
#define pb push_back
#define mp make_pair
#define sqr(n) (n) * (n)
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define per(i, a, b) for (int i = (a); i >= (b); --i)
#define IOS ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef vector<int> VI;
typedef double db;
 
template<class T1, class T2> bool umin(T1& a, T2 b) { return a > b ? (a = b, true) : false; }
template<class T1, class T2> bool umax(T1& a, T2 b) { return a < b ? (a = b, true) : false; }
template<class T> void clear(T& a) { T().swap(a); }
 
const int N = 2e5 + 5;
 
int n, m, _, k;
ll a[N];
 
int main() {
	IOS;
	for (cin >> _; _; --_) {
		cin >> n; ll mx = -1, s = 0;
        rep (i, 1, n) cin >> a[i], umax(mx, a[i]), s += a[i];
        ll ans = mx * (n - 1ll) - s;
        if (ans < 0) ans = (ans % (n - 1) + (n - 1)) % (n - 1);
        cout << ans << '\n';
    }
	return 0;
}