#include <bits/stdc++.h>
using namespace std;
template <typename T>
void make_unique(vector<T> &vec) {
  sort(vec.begin(), vec.end());
  vec.erase(unique(vec.begin(), vec.end()), vec.end());
}
void __print(long long x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
bool isprime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
const long long mod = 1000000007;
const long double PI = 3.141592653589793;
const int cons = 100001;
long long N, M;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long t = 0;
  cin >> t;
  for (long long test = 0; test < t; test++) {
    long long n = 0, m = 0, i = 0, j = 0, k = 0, cnt = 0, ans = 0, sum = 0,
              flag = 0, pos = 0, ind = 0, mn = 0, mx = 0, res = 0;
    cin >> n;
    vector<long long> v(n);
    for (i = 0; i < n; i++) {
      cin >> v[i];
    }
    cnt = 1;
    i = 1;
    while (i < n) {
      ans++;
      k = 1;
      while (cnt > 0) {
        while (v[i] <= v[i + 1] && i + 1 < n) {
          i++;
          k++;
          if (i == n) break;
        }
        cnt--;
        if (cnt > 0) {
          i++;
          k++;
        }
        if (i >= n) break;
      }
      cnt = k;
      i++;
      if (i >= n) break;
    }
    cout << ans << '\n';
  }
  return 0;
}
