#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
const int mod = 1e9 + 7;
long long a[200005];
struct node {
  long long w;
  long long deep;
};
int main() {
  long long t;
  scanf("%lld", &t);
  while (t--) {
    long long n;
    scanf("%lld", &n);
    for (int i = 0; i < n; i++) scanf("%lld", &a[i]);
    queue<node> que;
    node tt;
    tt.w = a[0];
    tt.deep = 0;
    que.push(tt);
    long long pos = 1;
    long long ans = -1;
    while (!que.empty()) {
      node now = que.front();
      ans = max(ans, now.deep);
      que.pop();
      long long temp = -1;
      while (temp < a[pos] && pos < n) {
        node tt;
        tt.w = a[pos];
        tt.deep = now.deep + 1;
        ans = max(ans, tt.deep);
        que.push(tt);
        temp = a[pos];
        pos++;
      }
      if (pos >= n) break;
    }
    while (!que.empty()) {
      node temp = que.front();
      que.pop();
      ans = max(temp.deep, ans);
    }
    printf("%lld\n", ans);
    ;
  }
}
