#include <bits/stdc++.h>
using namespace std;
template <class T>
void print(vector<T>& v) {
  for (T x : v) cout << x << " ";
  cout << "\n";
}
void inp(vector<int>& v, int n) {
  for (int i = 0; i < n; ++i) scanf("%d ", &v[i]);
}
void sol() {
  int n;
  cin >> n;
  vector<int> nums(n);
  inp(nums, n);
  queue<int> q;
  int res = 1, curr = 0, i = 1, x;
  q.push(1);
  q.push(-1);
  while (!q.empty() && i < n) {
    x = q.front();
    q.pop();
    if (x == -1) {
      res++;
      q.push(-1);
      continue;
    }
    while (x > 0) {
      curr = 1;
      while (i < n - 1 && nums[i] < nums[i + 1]) {
        i++;
        curr++;
      }
      i++;
      q.push(curr);
      x--;
    }
  }
  cout << res << endl;
  return;
}
int main() {
  int t;
  cin >> t;
  t++;
  for (int i = 1; i < t; ++i) {
    sol();
  }
  return 0;
}
