#include <bits/stdc++.h>
using namespace std;

void mainSolve()
{
	int N,s=0;
	cin >> N;
	for(int i=0;i<N;i++){
		int x;
		cin >> x;
		s+=x;
	}
	int k = 0;
	while(k*(k+1)<=2*s)
		k++;
	cout << (k-1) << endl;
}

int main()
{
  int t;
  cin >> t;
  while (t--)
  {
    mainSolve();
  }
  return 0;
}