#include <bits/stdc++.h>
using namespace std;
long long const INF = 1e12;
void sol() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (long long i = 0; i < n; i++) cin >> v[i];
  if (n == 1) {
    cout << "0\n";
    return;
  }
  int prelayer = 1;
  int next = 0;
  int h = 1;
  int i = 2;
  while (i < n) {
    if (v[i] > v[i - 1]) {
      prelayer++;
    } else {
      if (next == 0) {
        h++;
        next = prelayer - 1;
        prelayer = 1;
      } else {
        next--;
        prelayer++;
      }
    }
    i++;
  }
  cout << h << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int T = 1;
  cin >> T;
  while (T--) sol();
  return 0;
}
