#include <bits/stdc++.h>
using namespace std;
long long int mpow(long long int base, long long int exp);
void ipgraph(long long int m);
long long int dx[] = {-1, 0, 1, 0};
long long int dy[] = {0, 1, 0, -1};
const long long int mod = 1e9 + 7;
const long long int mxN = 2e5 + 10;
long long int a[mxN];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    for (long long int i = 1; i <= n; ++i) {
      cin >> a[i];
    }
    queue<long long int> q;
    q.push(a[1]);
    long long int height = 0;
    long long int i = 1;
    i++;
    while (i <= n) {
      height += 1;
      long long int s = q.size();
      while (s--) {
        q.pop();
        if (i <= n) q.push(a[i]);
        i++;
        while (i <= n && a[i] >= a[i - 1]) {
          q.push(a[i]);
          i++;
        }
      }
    }
    cout << height << endl;
  }
  return 0;
}
