#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long ar[n];
    for (long long i = 0; i < n; i++) {
      cin >> ar[i];
    }
    if (n == 1) {
      cout << "1\n";
      continue;
    }
    int i = 1, j = 1, cnt = 0, last = -1;
    while (i < n) {
      int k = 0;
      while (j--) {
        last = -1;
        while (i < n && ar[i] > last) {
          last = ar[i];
          i++;
          k++;
        }
      }
      j = k;
      cnt++;
    }
    cout << cnt << "\n";
  }
  return 0;
}
