#include <bits/stdc++.h>
using namespace std;
int codefo;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> codefo;
  while (codefo--) {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    int depth = 1;
    int cnt = 0;
    int cnt2 = 1;
    if (n == 2) {
      cout << 1 << endl;
      continue;
    }
    for (int i = 2; i < n; i++) {
      if (a[i] < a[i - 1]) {
        if (cnt == 0) {
          depth++;
          cnt = cnt2 - 1;
          cnt2 = 1;
        } else {
          cnt--;
          cnt2++;
        }
      } else {
        cnt2++;
      }
    }
    cout << depth << endl;
  }
}
