#define _GLIBCXX_FILESYSTEM
#include<bits/stdc++.h>
using namespace std;
#define ll long long
void solve() {
int n;
cin >> n;
ll sum = 0;
for(int i = 0; i < n; i++) {
ll x;
cin >> x;
sum += x;
}
ll x, l = 0, r = 1e9, mid;
while(l <= r) {
mid = l + (r - l) / 2;
ll now = mid * mid + mid - 2ll * sum;
if(now <= 0) {
x = mid;
l = mid + 1;
} else r = mid - 1;
}
cout << x + 1 << '\n';
return;
}
int32_t main() {
ios_base::sync_with_stdio(false);cin.tie(NULL);
int tc = 1;
cin >> tc;
for(int kase = 1; kase <= tc; kase++) {
//cout << "Case " << kase << ": ";
solve();
}
return 0;
}