#include <bits/stdc++.h>
using namespace std;
int N;
int A[200005];
inline int findAsc(int A[], int p) {
  for (++p; p <= N; ++p)
    if (A[p] < A[p - 1]) break;
  return p;
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &N);
    for (int i = 1; i <= N; ++i) scanf("%d", A + i);
    if (N == 1) {
      puts("0");
      continue;
    }
    int ans = 1;
    for (int num = 1, num2 = 0, i = 2, cnt = 0; i <= N;) {
      int j = findAsc(A, i);
      if (cnt >= num) {
        ++ans;
        num = num2;
        cnt = 0;
        num2 = 0;
      }
      ++cnt;
      num2 += j - i;
      i = j;
    }
    printf("%d\n", ans);
  }
  return 0;
}
