#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    int lv = 0, cp = 1, cr = 0, nx = 0;
    for (int i = 1; i < n; i++) {
      int j = i + 1;
      while (j < n and a[j] > a[j - 1]) j++;
      int sz = j - i;
      nx += sz;
      cr++;
      if (cr == cp) {
        lv++;
        cp = nx;
        nx = 0;
        cr = 0;
      }
      i = j - 1;
    }
    if (nx) lv++;
    cout << lv << "\n";
  }
  return 0;
}
