public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t!=0) {
int n = sc.nextInt();
int[] arr = new int[n];
for(int i = 0 ; i< n ;i++) {
arr[i] = sc.nextInt();
}
System.out.println(find(arr));
t–;
}
}
public static int find(int[] arr) {
int a=1, b = 1;
//int flag = 0;
for(int i = 0 ; i < arr.length - 1 ; i++) {
if(arr[i] <= arr[i+1] && b==1) {
a++;
}
else if(arr[i] >= arr[i+1] && a==1){
b++;
}
else {
break;
}
}
if(a==arr.length || b==arr.length) {
return arr.length;
}
//return 0;
int k = 1 , flag = 0 , max = 1, t=0;
for(int i = 0 ; i<arr.length -1 ;i++) {
if(arr[i] <= arr[i+1]) {
if(t==1) {
max = Math.max(max, k);
k=0;
t=0;
}
k++;
flag = 1;
}
else if(arr[i] >= arr[i+1] && flag == 1) {
k++;
t=1;
}
}
max = Math.max(max, k);
return max;
}