/*
 #include <ext/pb_ds/assoc_container.hpp>
 #include <ext/pb_ds/priority_queue.hpp>

 using namespace __gnu_pbds;


__gnu_pbds::priority_queue<int, less<int>> pq;
gp_hash_table<int, int> mp;
*/

/** Begin fast allocation */
/*
const int mx_MEM = 10 * 1e7;
int mpos = 0;
char mem[mx_MEM];

inline void *operator new(size_t n) {
    assert((mpos += n) <= mx_MEM);
    return (void *) (mem + mpos - n);
}

inline void operator delete(void *) noexcept {} // must have!
*/
/** End fast allocation */

/** Pragmas */
// mt19937 gen(2281337);

//#pragma GCC optimize("O3", "Ofast", "unroll-loops", "unswitch-loops", "fast-math", "no-stack-protector")

//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,abm,mmx,avx")
// sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,abm,mmx,
//#pragma comment(linker, "/STACK:66777216")

/*
 * @author kamil.sharipov
 */

#include <bits/stdc++.h>

//#define int long long
#define all(x) (x).begin(), (x).end()
#define fo(i, a, b) for (int i = a; i < b; ++i)
#define ll long long
#define pii pair<int, int>

using namespace std;

signed main() {
#ifdef _LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    int t;
    cin >> t;
    for (int i = 0; i < t; ++i) {
        ll n;
        cin >> n;

        vector<ll> a(n);
        ll sm = 0;
        ll mx = 0;
        for (int j = 0; j < n; ++j) {
            cin >> a[j];
            sm += a[j];
            mx = max(mx, a[j]);
        }

        if (mx * (n - 1) >= sm) {
            cout << mx * (n - 1) - sm;
        } else {
            cout << (n - 1 - sm % (n - 1)) % (n - 1);
        }
        cout << "\n";
    }
}

