1
3
5 3 4
 6
5
5 3 4 4 5
3
1 1 1
5
4 4 3 4 4
5
5 5 4 3 2
3
1 1 2
5
5 4 3 5 5
 1
3
10 1 5

1
 1
-1
2
2
3
1
 1

import java.io.*;
import java.util.*;
public class Main{
	static int search(int a[],int start,int end,int n){
		while(start <= end){
			// System.out.println("start = "+start+" "+"end ="+end);
			int mid = (start - ((start-end)/2));
			if(mid == 0){
				if(a[mid] > a[mid+1])
					return mid+1;
				else
					return -1;
			}
			else if(mid == n-1){
				if(a[mid] > a[mid-1]){
					return mid+1;
				}else
					return -1;
			}
			else if(mid > 0 && mid < n-1){
				if(a[mid] > a[mid-1] || a[mid] > a[mid+1]){
					return mid+1;
				}else if(a[mid] <= a[mid+1]){
					start = mid+1;
				}else if(a[mid] < a[mid-1]){
					end = mid-1;
				}
			}
			// System.out.println("start = "+start+" "+"end ="+end);
		}
		return -1;
	}
	public static void main(String args[]) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int t = Integer.parseInt(br.readLine());
		for(int l=0;l<t;l++){
			int n = Integer.parseInt(br.readLine());
			int a[] = new int[n];
			String s = br.readLine();
			s = s.trim();
			String f[] = s.split(" ");
			for(int i=0;i<n;i++){
				a[i] = Integer.parseInt(f[i]);
			}

			int ans = -1;
			ans = search(a,0,n-1,n);
			System.out.println(ans);
		}
	}
}