#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long long int a[n];
    for (long long int i = 0; i < n; i++) cin >> a[i];
    queue<long long int> q;
    q.push(a[0]);
    long long int k = 1, c = 0;
    while (k < n) {
      c++;
      queue<long long int> p;
      while (!q.empty()) {
        q.pop();
        p.push(a[k]);
        k++;
        for (; k < n; k++) {
          if (a[k] > a[k - 1])
            p.push(a[k]);
          else
            break;
        }
        if (k >= n) break;
      }
      q = p;
    }
    cout << c << "\n";
  }
  return 0;
}
