#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <cmath>
#include <map>
#include <stack>
#include <queue>
#include <iomanip>
#define MOD(x) (x + 1000000007) % (1000000007)

using namespace std;

template <class t>
using vec = vector<t>;
using ll = long long;

const ll MAX = numeric_limits<ll>::max();

template <class t>
ostream &operator<<(ostream &out, set<t> &v)
{
    out << "\n";
    for (t e : v)
        cout << e << " ";
    return out;
}

template <class t>
istream &operator>>(istream &in, vec<t> &v)
{
    for (t &e : v)
        in >> e;
    return in;
}

template <class t, class p>
ostream &operator<<(ostream &out, pair<t, p> &pr)
{
    cout << pr.first << pr.second << "\n";
    return out;
}

template <class t>
istream &operator>>(istream &in, pair<t, t> &p)
{
    in >> p.first >> p.second;
    return in;
}

int main()
{
    int t;
    cin >> t;
    for (ll n; t--;)
    {
        cin >> n;
        vec<ll> a(n);
        cin >> a;
        ll mx = *max_element(a.begin(), a.end()), su = accumulate(a.begin(), a.end(), 0ll);
        cout << max(mx * (n - 1) - su, (ll)ceil(float(su) / (n - 1)) * (n - 1) - su) << "\n";
    }
    return 0;
}