import java.util.Scanner;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
// write code here
public class Main {
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
while (in.hasNext()) {
int a = in.nextInt();
for (int i = 0; i < a; i++) {
int b = in.nextInt(),maxCount=1;
int[] dp = new int[b];
int[] arr = new int[b];
for (int j = 0; j < b; j++) {
arr[j] = in.nextInt();
dp[j]=1;
}
for (int k = 1; k < b; k++) {
for (int l = 0; l < k; l++) {
if (arr[k] > arr[l] && dp[l] + 1 > dp[k]) {
dp[k] = dp[l] + 1;
}
}
if (maxCount < dp[k]) {
maxCount = dp[k];
}
}
System.out.println(maxCount);
}
}
}
}