You are given an array a consisting of n integers (it is guaranteed that n is even, i.e. divisible by 2). All a_i does not exceed some integer k.

Your task is to replace the minimum number of elements (replacement is the following operation: choose some index i from 1 to n and replace a_i with some integer in range [1; k]) to satisfy the following conditions:

  * after all replacements, all a_i are positive integers not greater than k; 
  * for all i from 1 to n/2 the following equation is true: a_i + a_{n - i + 1} = x, where x should be the same for all n/2 pairs of elements. 



You have to answer t independent test cases.

Input

The first line of the input contains one integer t (1 ≤ t ≤ 10^4) — the number of test cases. Then t test cases follow.

The first line of the test case contains two integers n and k (2 ≤ n ≤ 2 ⋅ 10^5, 1 ≤ k ≤ 2 ⋅ 10^5) — the length of a and the maximum possible value of some a_i correspondingly. It is guratanteed that n is even (i.e. divisible by 2). The second line of the test case contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ k), where a_i is the i-th element of a.

It is guaranteed that the sum of n (as well as the sum of k) over all test cases does not exceed 2 ⋅ 10^5 (∑ n ≤ 2 ⋅ 10^5, ∑ k ≤ 2 ⋅ 10^5).

Output

For each test case, print the answer — the minimum number of elements you have to replace in a to satisfy the conditions from the problem statement.

Example

Input


4
4 2
1 2 1 2
4 3
1 2 2 1
8 7
6 1 1 7 6 3 4 6
6 6
5 2 6 1 3 4


Output


0
1
4
2
import java.io.*;
import java.util.*;

public class D {
	public static class segtree {
		long[] t;
		long[] lazy;
		int n;
		
		void update(int l, int r, long a) {update(1, 0, n-1, l, r, a);}
		long query(int l, int r) {return query(1,0,n-1,l,r);}
		public segtree(int len) {
			n=len;
			t = new long[n*4];
			lazy = new long[n*4];
		}
		
		void push(int v) {
			if (lazy[v] == 0) return;
			// t[v*2] = t[v*2+1] = t[v];
			// lazy[v*2] = lazy[v*2+1] = lazy[v];
			t[v*2] += lazy[v];
			lazy[v*2] += lazy[v];
			t[v*2+1] += lazy[v];
			lazy[v*2+1] += lazy[v];
			lazy[v] = 0;
		}
		
		void update(int v, int tl, int tr, int l, int r, long new_val) {
			if (l > r) return;
			if (l == tl && r == tr) {
				t[v] += new_val;
				lazy[v] += new_val;
			}
			else {
				push(v);
				int tm = (tl+tr)/2;
				update(v*2, tl, tm, l, Integer.min(r, tm), new_val);
				update(v*2+1, tm+1,tr, Integer.max(l, tm+1),r, new_val);
				t[v] = Long.min(t[v*2] , t[v*2+1]);
			}
		}
		
		long query(int v, int tl, int tr, int l, int r) {
			if (l > r) return Long.MAX_VALUE;
			if (l <= tl && tr <= r) return t[v];
			push(v);
			int tm = (tl+tr)/2;
			return Long.min(query(v*2, tl, tm, l, Integer.min(r, tm)) , query(v*2+1, tm+1, tr, Integer.max(l, tm+1), r));
		}
	}

	public static Reader sc = new Reader();
	//public static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	
	public static void main(String[] args) throws IOException {
		//BufferedReader br = new BufferedReader(new FileReader("input.in"));

		int t = sc.nextInt();
		while (t-- > 0) {
			int n = sc.nextInt();
			int k = sc.nextInt();
			segtree s = new segtree(2*k+1);
			s.update(0, 1, Long.MAX_VALUE);
			int[] a = new int[n];
			for (int i = 0; i  <n; i++) {
				a[i] = sc.nextInt();
			}
			for (int i  = 0; i < n/2; i++) {
				int l = a[i];
				int r = a[n-i-1];
				int min = Integer.min(l, r)+1;
				int max = Integer.max(l, r)+k;
				s.update(2, 2*k, 2);
				s.update(min, max, -1);
				s.update(l+r, l+r, -1);
			}
			out.println(s.query(0, 2*k));
		}

		out.close();
	}

	static long ceil(long a, long b) {
		return (a + b - 1) / b;
	}

	static long powMod(long base, long exp, long mod) {
		if (base == 0 || base == 1)
			return base;
		if (exp == 0)
			return 1;
		if (exp == 1)
			return base % mod;
		long R = powMod(base, exp / 2, mod) % mod;
		R *= R;
		R %= mod;
		if ((exp & 1) == 1) {
			return base * R % mod;
		} else
			return R % mod;
	}

	static long pow(long base, long exp) {
		if (base == 0 || base == 1)
			return base;
		if (exp == 0)
			return 1;
		if (exp == 1)
			return base;
		long R = pow(base, exp / 2);
		if ((exp & 1) == 1) {
			return R * R * base;
		} else
			return R * R;
	}

	static class Reader {
		final private int BUFFER_SIZE = 1 << 16;
		private DataInputStream din;
		private byte[] buffer;
		private int bufferPointer, bytesRead;

		public Reader() {
			din = new DataInputStream(System.in);
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public Reader(String file_name) throws IOException {
			din = new DataInputStream(new FileInputStream(file_name));
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public String readLine() throws IOException {
			byte[] buf = new byte[64]; // line length 
			int cnt = 0, c;
			while ((c = read()) != -1) {
				if (c == '\n') {
					break;
				}
				buf[cnt++] = (byte) c;
			}
			return new String(buf, 0, Integer.max(cnt - 1, 0));
		}

		public int nextInt() throws IOException {
			int ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');

			if (neg)
				return -ret;
			return ret;
		}

		public long nextLong() throws IOException {
			long ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');
			if (neg)
				return -ret;
			return ret;
		}

		public double nextDouble() throws IOException {
			double ret = 0, div = 1;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();

			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');

			if (c == '.') {
				while ((c = read()) >= '0' && c <= '9') {
					ret += (c - '0') / (div *= 10);
				}
			}

			if (neg)
				return -ret;
			return ret;
		}

		private void fillBuffer() throws IOException {
			bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
			if (bytesRead == -1)
				buffer[0] = -1;
		}

		private byte read() throws IOException {
			if (bufferPointer == bytesRead)
				fillBuffer();
			return buffer[bufferPointer++];
		}

		public void close() throws IOException {
			if (din == null)
				return;
			din.close();
		}
	}

	public static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
}
