#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    int ht = 1, child = 1, ign = 0, prev = 1;
    for (int i = 2; i < n; i++) {
      if (a[i] >= a[i - 1]) {
        child++;
      } else {
        ign++;
        if (ign >= prev) {
          ht++;
          prev = child;
          child = 1;
          ign = 0;
        } else
          child++;
      }
    }
    cout << ht << "\n";
  }
}
