#include <bits/stdc++.h>
#define pb push_back
#define int long long
using namespace std;
const int mod = 998244353;
const int inf = 1e9 + 20;
const int N = 1e5+5;
int32_t main(){
cin.tie(0); cout.tie(0);
ios_base::sync_with_stdio(false);
int t;
cin>>t;
while(t--){
int n;
cin>>n;
vector<int> a(n);
int sum = 0;
for(int i = 0; i < n; i++){
cin>>a[i];
sum += a[i];
}
int l = 0, r = inf;
while(l < r){
int m = (l + r)/2;
if(m * (m + 1) / 2 > sum) r = m;
else l = m + 1;
}
if(l * (l + 1) / 2 > sum) l--;
cout<<l + 1<<endl;
}
return 0;
}