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

//package cf.c1433;

import java.io.*;
import java.util.StringTokenizer;

public class C {

    public static void main(String[] args) throws IOException {
        final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(br.readLine());

        final BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        while (t-- > 0) {
            int n = Integer.parseInt(br.readLine());
            final int[] a = readArray(br, n);

            bw.write(solve(a) + "\n");
        }
        bw.flush();
    }

    private static int solve(int[] a) {
        for (int i = 0; i < a.length; i++) {
            if (check(a, i)) return i;
        }
        return -1;
    }

    private static boolean check(int[] a, int i) {
        int l = i - 1;
        int r = i + 1;

        int cur = a[i];
        while (true) {
            if (l < 0 && r == a.length) return true;
            if (l >= 0 && cur > a[l]) {
                l--;
                cur++;
            } else if (r < a.length && cur > a[r]) {
                r++;
                cur++;
            } else {
                return false;
            }
        }
    }

    private static int[] readArray(BufferedReader br, int n) throws IOException {
        int[] arr = new int[n];
        final StringTokenizer st = new StringTokenizer(br.readLine());
        for (int i = 0; i < n; i++) {
            arr[i] = Integer.parseInt(st.nextToken());
        }
        return arr;
    }
}
