#include <bits/stdc++.h>
using namespace std;
int num[200010];
int main() {
  int test, i, n;
  cin >> test;
  while (test--) {
    int dep = 1, ans = 1, nowchild = 1, lastchild = 1;
    cin >> n;
    for (i = 1; i <= n; i++) cin >> num[i];
    for (i = 3; i <= n; i++) {
      if (ans < lastchild) {
        nowchild++;
        if (num[i] <= num[i - 1]) {
          ans++;
        }
      } else if (ans == lastchild) {
        if (num[i] > num[i - 1])
          nowchild++;
        else {
          lastchild = nowchild;
          nowchild = ans = 1;
          dep++;
        }
      }
    }
    cout << dep << endl;
  }
  return 0;
}
