/**
* @author: Binoy Barman
* @created: 2024-11-05 20:56:16
**/
#include<bits/stdc++.h>
using namespace std;
#define nl '\n'
#define all(v) v.begin(), v.end()
#define Too_Many_Jobs int tts, tc = 1; cin >> tts; hell: while(tts--)
#define Dark_Lord_Binoy ios_base::sync_with_stdio(false); cin.tie(NULL);
#ifdef LOCAL
#include "debug/whereisit.hpp"
#else
#define dbg(...) 42
#endif
#define int long long
int32_t main() {
Dark_Lord_Binoy
#ifdef LOCAL
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
Too_Many_Jobs {
int n;
cin >> n;
int sum = 0;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
sum += x;
}
int L = 1, H = 2e9, mid, ans = 0;
while(L <= H) {
mid = (L + H) / 2;
int cur = (mid * (mid + 1)) / 2;
if(cur <= sum) {
ans = mid;
L = mid + 1;
} else {
H = mid - 1;
}
}
cout << ans + 1 << nl;
}
return 0;
}