#include <bits/stdc++.h>
using namespace std;
std::vector<pair<int, int>> arr[1000001];
int in[1000001];
int vis[1000001];
int siz[1000001];
vector<int> ans;
void dfs(int node, int d) {
  vis[node] = 1;
  if (arr[node].size() == 0) {
    ans.push_back(node);
    ans.push_back(d);
  }
  for (auto it : arr[node]) {
    if (vis[it.first] == 0) {
      d = std::min(d, it.second);
      dfs(it.first, d);
    }
  }
}
long long int power(long long int a, long long int b) {
  long long int ans = 1;
  long long int num = a;
  while (b > 0) {
    if (b & 1) ans = ((ans % 1000000007) * (num % 1000000007)) % 1000000007;
    num = ((num % 1000000007) * (num % 1000000007)) % 1000000007;
    b /= 2;
  }
  return ans;
}
long long int lps[1000005];
void lpps(string s) {
  long long int i = 0;
  long long int j = 1;
  long long int n = s.size();
  while (j < n and i < n) {
    if (s[i] == s[j]) {
      lps[j] = i + 1;
      i++;
      j++;
    } else {
      if (i == 0) {
        j++;
      } else {
        i = lps[i - 1];
      }
    }
  }
}
bool isPalindrome(string s) {
  if (s.size() == 1) return false;
  for (int i = 0; i < s.size() / 2; i++) {
    if (s[i] != s[s.size() - 1 - i]) {
      return false;
    }
  }
  return true;
}
bool isPrime(long long int n) {
  for (long long int i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
long long int fact(long long int n) {
  if (n == 1)
    return 1;
  else
    return n * fact(n - 1);
}
long long int comb(long long int n, long long int r) {
  return fact(n) / (fact(n - r) * fact(r));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  cin >> t;
  while (t-- > 0) {
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    queue<int> q;
    int i = 0;
    q.push(a[i]);
    i++;
    int h = 0;
    while (i < n && q.size()) {
      int count = q.size();
      h++;
      while (count-- > 0 && i < n) {
        q.push(a[i]);
        i++;
        while (i < n && a[i] > a[i - 1]) q.push(a[i]), i++;
        q.pop();
      }
    }
    cout << h << endl;
  }
  return 0;
}
