#include <bits/stdc++.h>
#define int long long
#define sqrtl(x) sqrt(x)
using namespace std;
namespace solve {
namespace test_case {
void main() {
int n; cin >> n;
vector<int> a(n);
for (auto &x: a) cin >> x;
auto sum = accumulate(a.begin(), a.end(), 0LL);
int l (0), r (1e9), mex (1);
while (l <= r) {
int m ((l + r) / 2);
if (m * (m + 1) / 2 <= sum) l = m + 1, mex = m + 1;
else r = m - 1;
}
cout << mex << '\n';
}
}
void main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t (1); cin >> t;
while (t--) {
test_case::main();
}
}
}
signed main() { solve::main(); }