#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 3;
int ar[N];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
      scanf("%d", &ar[i]);
    }
    ar[n] = 0;
    int now = 1, nx = 0, ans = 1;
    for (int i = 1; i < n; i++) {
      if (now == 0) {
        now = nx;
        nx = 0;
        ans++;
      }
      if (ar[i] > ar[i + 1]) {
        now--;
      }
      nx++;
    }
    printf("%d\n", ans);
  }
}
