#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void test_case() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  int level = 0;
  int last = 0;
  int numVertex = 1;
  int nextLevelVertex = 0;
  int i = 1;
  while (i < n) {
    while (i < n and numVertex) {
      last = 0;
      while (i < n and a[i] > last) {
        last = a[i];
        i++;
        nextLevelVertex++;
      }
      --numVertex;
    }
    numVertex = nextLevelVertex;
    nextLevelVertex = 0;
    level++;
  }
  cout << level << endl;
}
int main() {
  int tests;
  cin >> tests;
  for (int i = 0; i < tests; ++i) {
    test_case();
  }
  return 0;
}
