#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  int curr = 1;
  int next = 0;
  int ans = 1;
  for (int i = 1; i < n; i++) {
    if (v[i] < v[i - 1]) {
      curr--;
      if (curr == 0) {
        ans++;
        curr = next;
      }
    } else {
      next++;
    }
  }
  cout << ans << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
