#include <iostream>
#include <cmath>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T;
cin >> T;
while(T--){
int N;
cin >> N;
long long S = 0;
for (int i = 0; i < N; i++){
long long x;
cin >> x;
S += x;
}
// We want the maximum integer k such that k*(k-1)/2 <= S.
// Solve k^2 - k - 2S <= 0.
// The positive root is k = (1 + sqrt(1+8S)) / 2.
long double disc = sqrt((long double)(1 + 8 * S));
long long k = floor((1 + disc) / 2);
// Adjust if necessary:
while(k * (k - 1LL) / 2 > S) k--;
while((k + 1LL) * k / 2 <= S) k++;
cout << k << "\n";
}
return 0;
}