#include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
/* constant */
const int INF = 1 << 30;
const ll LINF = 1LL << 61;
const int NIL = -1;
const int MAX = 10000;
const int MOD = 1000000007;
const double pi = 3.141592653589;
/* global variables */
/* function */
void query() {
    int N;
    cin >> N;
    vector<int> box(N);
    for (int &bi : box) cin >> bi;

    ll sum = accumulate(box.begin(), box.end(), 0LL);
    ll mx = *max_element(box.begin(), box.end());

    ll ret = max(mx * (N - 1), sum);
    while (ret % (N - 1) != 0) {
        ret++;
    }
    cout << (ret - sum) << '\n';
}
void solve() {
    int t;
    cin >> t;
    for (int i = 0; i < t; i++) {
        query();
    }
}
/* main */
int main(){
    solve();
}
