#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  cin >> n;
  vector<long long int> v(n);
  for (long long int i = 0; i < n; i++) cin >> v[i];
  long long int node = 1, new_node = 0, level = 0;
  for (long long int i = 1; i < n; i++) {
    new_node = 0;
    for (long long int j = 0; j < node and i < n; j++) {
      long long int prev = INT_MIN;
      while (i < n and v[i] > prev) {
        prev = v[i];
        new_node++;
        i++;
      }
    }
    i--;
    node = new_node;
    level++;
  }
  cout << level << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ;
  long long int T;
  cin >> T;
  while (T--) {
    solve();
  }
  return 0;
}
