#include <bits/stdc++.h>
using namespace std;
const int MAX = (int)1e5 + 10;
int main() {
  ios::sync_with_stdio(false);
  ;
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    if (n == 1) {
      cout << 0 << endl;
      continue;
    }
    int h = 0;
    int left = 1;
    int val = 0;
    int aux = 1;
    for (int i = 1; i < n; i++) {
      val++;
      while (i < n - 1 and a[i] < a[i + 1]) {
        i++;
        val++;
      }
      if (aux == 1) {
        h++;
      }
      if (aux < left) {
        aux++;
      } else {
        left = val;
        val = 0;
        aux = 1;
      }
    }
    cout << h << endl;
  }
  return 0;
}
