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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;


 
public class A
{
	static class FastReader 
	{ 
	    BufferedReader br; 
	    StringTokenizer st; 

	    public FastReader() 
	    { 
	        br = new BufferedReader(new
	                 InputStreamReader(System.in)); 
	    } 

	    String next() 
	    { 
	        while (st == null || !st.hasMoreElements()) 
	        { 
	            try
	            { 
	                st = new StringTokenizer(br.readLine()); 
	            } 
	            catch (IOException  e) 
	            { 
	                e.printStackTrace(); 
	            } 
	        } 
	        return st.nextToken(); 
	    } 

	    int nextInt() 
	    { 
	        return Integer.parseInt(next()); 
	    } 

	    long nextLong() 
	    { 
	        return Long.parseLong(next()); 
	    } 

	    double nextDouble() 
	    { 
	        return Double.parseDouble(next()); 
	    } 

	    String nextLine() 
	    { 
	        String str = ""; 
	        try
	        { 
	            str = br.readLine(); 
	        } 
	        catch (IOException e) 
	        { 
	            e.printStackTrace(); 
	        } 
	        return str; 
	    } 
	}
	
	
	static class Pair
	{
		long o;
		long z;
		Pair(long o,long z)
		{
			this.o = o;
			this.z = z;
		}
	}
	
	static class Node
	{
		Node l;
		Node r;
		char ch;
		Node(char ch)
		{	
			this.ch = ch;
		}
	}
	static int gcd(int a,int b)
	{
		if(a == 0) return b;
		if(b == 0) return a;
		
		return gcd(b,a%b);
	}
	static long gcd(long a,long b)
	{
		if(a == 0) return b;
		if(b == 0) return a;
		
		return gcd(b,a%b);
	}
	static void preCompute(long fact[])
	{
		fact[0] = 1;
		for(int i = 1; i < fact.length; i++)
		{
			fact[i] = i*fact[i-1]%rem;
		}
	}
	static long power(long x, long y, long p) 
    { 
        long res = 1; 
        x = x % p; 
                      
        while (y > 0) 
        {
            if (y % 2 == 1) 
                res = (res * x) % p; 
 
            y = y >> 1; 
            x = (x * x) % p; 
        }
        return res; 
    } 
	static long modInverse(long n, long p) 
    { 
        return power(n, p-2, p); 
    }
	
	static long nCrModPFermat(int n, int r, long p) 
	{ 
 
		if (r == 0) 
			return 1; 
 
		return (fact[n]* modInverse(fact[r], p) % p * modInverse(fact[n-r], p) % p) % p; 
	}
	static long rem = 998244353L;
	static long fact[];
	
	static ArrayList<Integer> ar = new ArrayList<>();
	static void sieve(int n)
	{	
		//System.out.println(n);
		boolean prime[] = new boolean[n+1];
		for(int i=0;i<= n;i++) 
			prime[i] = true; 
      
		for(int p = 2; p*p <=n; p++) 
		{	 
        
			if(prime[p] == true) 
			{ 	
				for(int i = p*p; i <= n; i += p) 
					prime[i] = false; 
			} 
		} 
		
		for(int i = 2; i <= n; i++)
		{
			if(prime[i]) ar.add(i);
		}
	}
	
	
	static long mod = (long)(1e9)+7;
	
	public static long removeAlternate(long n) 
    { 
        if (n == 1) 
            return 1; 
  
        if (n % 2 == 0) 
            return 2 * removeAlternate(n / 2) - 1; 
        else
            return 2 * removeAlternate(((n - 1) / 2)) + 1; 
    }
	
	static class Bit2
	{
	    int BITree[];

	    Bit2(int n)
	    {
	        BITree = new int[2*n];
	    }

	    void updateBIT(int n, int index, int val)
	    {
	        // index in BITree[] is 1
	        // more than the index in arr[]
	        index = index + 1;

	        // Traverse all ancestors
	        // and add 'val'
	        while (index <= n)
	        {
	            // Add 'val' to current
	            // node of BITree
	            BITree[index] += val;

	            // Update index to that
	            // of parent in update View
	            index += index & (-index);
	        }
	    }


	    int getSum(int index)
	    {
	        int sum = 0;

	        index = index + 1;

	        while (index > 0)
	        {
	            sum += BITree[index];

	            index -= index & (-index);
	        }

	        return sum;
	    }


	    void update(int l, int r,int n, int val)
	    {
	        // Increase value at
	        // 'l' by 'val'
	        updateBIT(n, l, val);

	        // Decrease value at
	        // 'r+1' by 'val'
	        updateBIT(n, r + 1, -val);
	    }
	}
	
	public static void main(String[] args) 
	{
		OutputStream outputStream = System.out;
		FastReader sc = new FastReader();
        PrintWriter out = new PrintWriter(outputStream);
        
        int t = sc.nextInt();
        
        while(t-- > 0)
        {
        	int n = sc.nextInt();
        	int k = sc.nextInt();
        	
        	int a[] = new int[n+1];
        	int map[] = new int[2*k+1];
        	for(int i = 1; i <= n; i++)
        	{
        		a[i] = sc.nextInt();
        	}
        	
        	Bit2 bit = new Bit2(2*k+1);
        	
        	for(int i = 1; i <= n/2; i++)
        	{	
        		
        		int sum = a[i]+a[n-i+1];
        		map[sum]++;
        		int min = Math.min(a[i],a[n-i+1])+1;
        		int max = Math.max(a[i],a[n-i+1])+k;
        		
        		bit.update(min,max,2*k+1,1);
        	}
        	
        	int ans = Integer.MAX_VALUE;
        	
        	for(int i = 2; i <= 2*k; i++)
        	{
        		int x = bit.getSum(i);
        		
        		int y = x;
        		y -= map[i];
        		
        		int z = n-2*x;
        		//System.out.println(x+" "+y+" "+z+" "+i);
        		y += z;
        		
        		ans = Math.min(ans, y);
        	}
        	
        	out.println(ans);
        	
        }
        out.close();
	}
	
	/*
	 4
4 1
1 1 1 1
6 2
1 1 1 2
1 1
8 10
1 2 3 4 5 6 7 8
10 5
1 2 3 4 5 5 5 5 5 5
	 */
 
}