description: Pchelyonok decided to give Mila a gift. Pchelenok has already bought an array a of length n, but gifting an array is too common. Instead of that, he decided to gift Mila the segments of that array!
  
  Pchelyonok wants his gift to be beautiful, so he decided to choose k non-overlapping segments of the array [l_1,r_1], [l_2,r_2], … [l_k,r_k] such that:
  
    * the length of the first segment [l_1,r_1] is k, the length of the second segment [l_2,r_2] is k-1, …, the length of the k-th segment [l_k,r_k] is 1 
    * for each i<j, the i-th segment occurs in the array earlier than the j-th (i.e. r_i<l_j) 
    * the sums in these segments are strictly increasing (i.e. let sum(l … r) = ∑_{i=l}^{r} a_i — the sum of numbers in the segment [l,r] of the array, then sum(l_1 … r_1) < sum(l_2 … r_2) < … < sum(l_k … r_k)). 
  
  
  
  Pchelenok also wants his gift to be as beautiful as possible, so he asks you to find the maximal value of k such that he can give Mila a gift!
  
  Input
  
  The first line contains a single integer t (1 ≤ t ≤ 100) — the number of test cases. The next 2 ⋅ t lines contain the descriptions of test cases. The description of each test case consists of two lines.
  
  The first line of each test case contains a single integer n (1 ≤ n ≤ 10^5) — the length of the array.
  
  The second line contains n integers a_1, a_2, …, a_n (1 ≤ a_i ≤ 10^9) — the elements of the array a.
  
  It is guaranteed that the sum of n over all test cases does not exceed 10^5.
  
  Output
  
  For each test case, print the maximum possible value of k.
  
  Example
  
  Input
  
  
  5
  1
  1
  3
  1 2 3
  5
  1 1 2 2 3
  7
  1 2 1 1 3 2 6
  5
  9 6 7 9 7
  
  
  Output
  
  
  1
  1
  2
  3
  1
solution: import java.util.*;
  import java.io.*;
  
  ////***************************************************************************
   /* public class E_Gardener_and_Tree implements Runnable{
  
         public static void main(String[] args) throws Exception {
          new Thread(null, new E_Gardener_and_Tree(), "E_Gardener_and_Tree", 1<<28).start();
         }
      public void run(){
           WRITE YOUR CODE HERE!!!!
           JUST WRITE EVERYTHING HERE WHICH YOU WRITE IN MAIN!!!
         }
  
    }
  */
  /////**************************************************************************
  
  
  public class E_Pchelyonok_and_Segments{
      public static void main(String[] args) {
          FastScanner s= new FastScanner();
         // PrintWriter out=new PrintWriter(System.out);
          //end of program
          //out.println(answer);
          //out.close();
          StringBuilder res = new StringBuilder();
          int t=s.nextInt();
          int p=0;
          while(p<t){
          int n=s.nextInt();
          int array[]=new int[n];
          long val=0;
          long sum[]= new long[n];
          for(int i=0;i<n;i++){
              array[i]=s.nextInt();
              val+=array[i];
              sum[i]=val;
          }
          long size=(long)Math.sqrt((2*n));
          // long yo=(long)Math.sqrt(200000);
          // System.out.println(yo);
         size+=2;
          boolean dp[][]= new boolean[n][(int)size];
          long matrix[]= new long[n];
         // System.out.println(size);
         // System.out.println(dp[0].length);
         
          long max=-1;
          for(int i=n-1;i>=0;i--){
             // System.out.println(i+" i");
              dp[i][1]=true;
              max=Math.max(max,array[i]);
              matrix[i]=max;
          }
         
  
        
         
         
          for(int i=2;i<size;i++){
              long val1=i;
              long num2=(val1*(1+val1))/2;
              long nice[]= new long[n];
              int num=(int)num2;
              for(int j=n-num;j>=0;j--){
                  int index=j+i;
                  long value=sum[j+i-1];
                  if(j-1>=0){
                      value-=sum[j-1];
                  }
                  if(matrix[index]==0){
                      dp[j][i]=false;
                     
                      nice[j]=Math.max(0,nice[j+1]);
                  }
                  else{
                      long number=matrix[index];
                      if(number>value){
                          dp[j][i]=true;
                        
                          nice[j]=Math.max(nice[j+1],value);
  
                      }
                      else{
                          dp[j][i]=false;
                          nice[j]=Math.max(0,nice[j+1]);
                      }
  
                  }
              }
              matrix=nice;
  
          }
          int ans=0;
          for(int i=(int)size-1;i>=1;i--){
              int check=0;
                 for(int j=0;j<n;j++){
                     if(dp[j][i]==true){
                         ans=i;
                         check=1;
                         break;
                     }
                 }
                 if(check==1){
                     break;
                 }
          }
          res.append(ans+"\n");
          p++;
      }
      System.out.println(res);
  
  
  
      }
      static class FastScanner {
  		BufferedReader br;
  		StringTokenizer st;
   
  		public FastScanner(String s) {
  			try {
  				br = new BufferedReader(new FileReader(s));
  			} catch (FileNotFoundException e) {
  				// TODO Auto-generated catch block
  				e.printStackTrace();
  			}
  		}
   
  		public FastScanner() {
  			br = new BufferedReader(new InputStreamReader(System.in));
  		}
   
  		String nextToken() {
  			while (st == null || !st.hasMoreElements()) {
  				try {
  					st = new StringTokenizer(br.readLine());
  				} catch (IOException e) {
  					// TODO Auto-generated catch block
  					e.printStackTrace();
  				}
  			}
  			return st.nextToken();
  		}
   
  		int nextInt() {
  			return Integer.parseInt(nextToken());
  		}
   
  		long nextLong() {
  			return Long.parseLong(nextToken());
  		}
   
  		double nextDouble() {
  			return Double.parseDouble(nextToken());
  		}
  	}
  
  
  
  
  }