import java.io.*;
public class Solution{
	public static void main(String args[])throws IOException
	{
		InputStreamReader c = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(c);

		int t = Integer.parseInt(br.readLine());
		for(int test = 0; test < t; test++ )
		{
			long n = Long.parseLong(br.readLine());
			if(n%4 != 0)
			    System.out.println("NO");
			 else
			 {
			     System.out.println("YES");
			     String s = "";
			     int countEven = 0, countOdd = 0;
			     for(int i = 2; i <= n; i=i+2)
			     {
			         s += Integer.toString(i) + " ";
			         countEven += i;
			     }
			     for(int i = 1;i < (n-1); i=i+2)
			     {
			         s += Integer.toString(i) + " ";
			         countOdd += i;
			     }
			     int dif = countEven - countOdd;
			     s += Integer.toString(dif);
			     System.out.println(s);
			 }

		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.StringTokenizer;
	public class Solution{

	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;
        }
    }

	public static void main(String args[])throws IOException
	{
		FastReader sc=new FastReader();

		int t = sc.nextInt();
		String res = "";
		for(int test = 0; test < t; test++ )
		{
			long n = sc.nextLong();
			if(n%4 != 0)
			    res += "NO\n";
			 else
			 {
			     res += "YES\n";
			     String s = "";
			     int countEven = 0, countOdd = 0;
			     for(int i = 2; i <= n; i=i+2)
			     {
			         s += Integer.toString(i) + " ";
			         countEven += i;
			     }
			     for(int i = 1;i < (n-1); i=i+2)
			     {
			         s += Integer.toString(i) + " ";
			         countOdd += i;
			     }
			     int dif = countEven - countOdd;
			     s += Integer.toString(dif);
			     res += s + "\n";
			 }
		}
		System.out.println(res);
	}
}


import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt();
        while(t-->0){
            int n=sc.nextInt();
            if(n%4==0){
                System.out.println("YES");
                for(int i=1;i<=n;i++){
                    if(i%2==0)
                    System.out.print(i+" ");
                }
                for(int i=1;i<n;i++){
                    if(i%2!=0)
                    System.out.print(i+" ");
                }
            }
            else{
                System.out.print("NO");
            }
            System.out.println();
        }
    }
}


import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt();
        while(t-->0){
            int n=sc.nextInt();
            if(n%4==0){
                System.out.println("YES");
                for(int i=1;i<=n;i++){
                    if(i%2==0)
                    System.out.print(i+" ")
                }
                for(int i=1;i<=n;i++){
                    if(i%2!=0)
                    System.out.print(i+" ");
                }
            }
            else{
                System.out.print("NO");
            }
            System.out.println();
        }
    }
}


import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt();
        while(t-->0){
            int n=sc.nextInt();
            if(n%4==0){
                System.out.println("YES");
                for(int i=1;i<=n;i++){
                    if(i%2==0)
                    System.out.print(i+" ");
                }
                for(int i=1;i<=n;i++){
                    if(i%2!=0)
                    System.out.print(i+" ");
                }
            }
            else{
                System.out.print("NO");
            }
            System.out.println();
        }
    }
}


import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt();
        while(t-->0){
            int n=sc.nextInt();
            if(n%4==0){
                System.out.println("YES");
                for(int i=1;i<=n;i++){
                    if(i%2==0)
                    System.out.print(i+" ");
                }
                int x=0;
                for(int i=1;i<n;i++){
                    x=i;
                    if(i%2!=0&&i!=n-1)
                    System.out.print(i+" ");
                }
                System.out.print(x+(n/2));
            }
            else{
                System.out.print("NO");
            }
            System.out.println();
        }
    }
}


package Demo;

import java.util.ArrayList;
import java.util.Scanner;

public class Prac1 {
	public static void main(String[] args) {
		int t,n=0,evnum=0,onum=0,sume=0,sumo=0;
		Scanner s = new Scanner(System.in);
		t=s.nextInt();
		while(t-->0) {
			n=s.nextInt();
			ArrayList<Integer> a = new ArrayList<Integer>();
			if(((n/2)&1) == 0) {
				evnum=2;
				onum=1;
				sume=0;
				sumo=0;
				System.out.println("YES");
				for(int j=0;j<(n/2);j++) {
					a.add(j, evnum);
					sume=sume+evnum;
					evnum=evnum+2;
					//System.out.print(a.get(j)+" ");
				}
				for(int k=n/2;k<n-1;k++) {
					a.add(k, onum);
					sumo=sumo+onum;
					onum=onum+2;
					//System.out.print(a.get(k)+" ");
				}
				a.add(n-1, sume-sumo);
				for(int i = 0; i < a.size(); i++){
				    System.out.print(a.get(i) + " ");
				}
				System.out.println();
				//System.out.print(a.get(n-1)+" ");
				//System.out.print("\n");
			}else {
				System.out.println("NO");
			}
		}
	}
}


package Demo;

import java.util.ArrayList;
import java.util.Scanner;

public class Prac1 {
	public static void main(String[] args) {
		int t,n=0,evnum=0,onum=0,sume=0,sumo=0;
		Scanner s = new Scanner(System.in);
			t=s.nextInt();
			while(t-->0) {
				n=s.nextInt();
				ArrayList<Integer> a = new ArrayList<Integer>();
				if((n/2)%2==0) {
					evnum=2;
					onum=1;
					sume=0;
					sumo=0;
					System.out.println("YES");
					for(int j=0;j<(n/2);j++) {
						a.add(j, evnum);
						sume=sume+evnum;
						evnum=evnum+2;
						System.out.print(a.get(j)+" ");
					}
					for(int k=n/2;k<n-1;k++) {
						a.add(k, onum);
						sumo=sumo+onum;
						onum=onum+2;
						System.out.print(a.get(k)+" ");
					}
					a.add(n-1, sume-sumo);
					System.out.print(a.get(n-1)+" ");
					System.out.print("\n");
				}else {
					System.out.println("NO");
				}
			}
		}
}


package Demo;

import java.util.ArrayList;
import java.util.Scanner;

public class Prac1 {
	public static void main(String[] args) {
		int t,n=0,evnum=0,onum=0,sume=0,sumo=0;
		Scanner s = new Scanner(System.in);
		t=s.nextInt();
		while(t-->0) {
			n=s.nextInt();
			ArrayList<Integer> a = new ArrayList<Integer>();
			if((n/2)%2==0) {
				evnum=2;
				onum=1;
				sume=0;
				sumo=0;
				System.out.println("YES");
				for(int j=0;j<(n/2);j++) {
					a.add(j, evnum);
					sume=sume+evnum;
					evnum=evnum+2;
					//System.out.print(a.get(j)+" ");
				}
				for(int k=n/2;k<n-1;k++) {
					a.add(k, onum);
					sumo=sumo+onum;
					onum=onum+2;
					//System.out.print(a.get(k)+" ");
				}
				a.add(n-1, sume-sumo);
				for(int i = 0; i < a.size(); i++){
				    System.out.print(a.get(i) + " ");
				}
				System.out.println();
				//System.out.print(a.get(n-1)+" ");
				//System.out.print("\n");
			}else {
				System.out.println("NO");
			}
		}
	}
}


import java.util.ArrayList;
import java.util.Scanner;

public class Prac1 {
	public static void main(String[] args) {
		int t,n=0,evnum=0,onum=0,sume=0,sumo=0;
		Scanner s = new Scanner(System.in);
		t=s.nextInt();
		while(t-->0) {
			n=s.nextInt();
			ArrayList<Integer> a = new ArrayList<Integer>();
			if((n/2)%2==0) {
				evnum=2;
				onum=1;
				sume=0;
				sumo=0;
				System.out.println("YES");
				for(int j=0;j<(n/2);j++) {
					a.add(j, evnum);
					sume=sume+evnum;
					evnum=evnum+2;
					//System.out.print(a.get(j)+" ");
				}
				for(int k=n/2;k<n-1;k++) {
					a.add(k, onum);
					sumo=sumo+onum;
					onum=onum+2;
					//System.out.print(a.get(k)+" ");
				}
				a.add(n-1, sume-sumo);
				for(int i = 0; i < a.size(); i++){
				    System.out.print(a.get(i) + " ");
				}
				System.out.println();
				//System.out.print(a.get(n-1)+" ");
				//System.out.print("\n");
			}else {
				System.out.println("NO");
			}
		}
	}
}


import java.util.ArrayList;
import java.util.Scanner;

public class Prac1 {
	public static void main(String[] args) {
		int t,n=0,evnum=0,onum=0,sume=0,sumo=0;
		ArrayList<Integer> a = new ArrayList<Integer>();
		Scanner s = new Scanner(System.in);
			t=s.nextInt();
			while(t-->0) {
				n=s.nextInt();
				if((n/2)%2==0) {
					evnum=2;
					onum=1;
					sume=0;
					sumo=0;
					System.out.println("YES");
					for(int j=0;j<(n/2);j++) {
						a.add(j, evnum);
						sume=sume+evnum;
						evnum=evnum+2;
						System.out.print(a.get(j)+" ");
					}
					for(int k=n/2;k<n-1;k++) {
						a.add(k, onum);
						sumo=sumo+onum;
						onum=onum+2;
						System.out.print(a.get(k)+" ");
					}
					a.add(n-1, sume-sumo);
					System.out.print(a.get(n-1)+" ");
					System.out.print("\n");
				}else {
					System.out.println("NO");
				}
			}
		}
}


import java.util.ArrayList;
import java.util.Scanner;

public class Prac1 {
	public static void main(String[] args) {
		int t,n=0,evnum=0,onum=0,sume=0,sumo=0;
		Scanner s = new Scanner(System.in);
		t=s.nextInt();
		while(t-->0) {
			n=s.nextInt();
			ArrayList<Integer> a = new ArrayList<Integer>();
			if(((n/2)&1) == 0) {
				evnum=2;
				onum=1;
				sume=0;
				sumo=0;
				System.out.println("YES");
				for(int j=0;j<(n/2);j++) {
					a.add(j, evnum);
					sume=sume+evnum;
					evnum=evnum+2;
					//System.out.print(a.get(j)+" ");
				}
				for(int k=n/2;k<n-1;k++) {
					a.add(k, onum);
					sumo=sumo+onum;
					onum=onum+2;
					//System.out.print(a.get(k)+" ");
				}
				a.add(n-1, sume-sumo);
				for(int i = 0; i < a.size(); i++){
				    System.out.print(a.get(i) + " ");
				}
				System.out.println();
				//System.out.print(a.get(n-1)+" ");
				//System.out.print("\n");
			}else {
				System.out.println("NO");
			}
		}
	}
}


import java.util.*;

import java.io.*;
import java.math.BigInteger;

public class A {

	static BufferedReader br;
	static PrintWriter pw;
	static int inf = (int) 1e9;
	static long mod = (long) 1e9 + 7;

	static String ans;

	static int n, k;

	static ArrayList<Integer> primes;
	static int[] isComposite;

	static void sieve(int N) // O(N log log N)
	{
		isComposite = new int[N + 1];
		isComposite[0] = isComposite[1] = 1; // 0 indicates a prime number
		primes = new ArrayList<Integer>();

		for (int i = 2; i <= N; ++i) // can loop till i*i <= N if primes array is not needed O(N log log sqrt(N))
			if (isComposite[i] == 0) // can loop in 2 and odd integers for slightly better performance
			{
				primes.add(i);
				if (1l * i * i <= N)
					for (int j = i * i; j <= N; j += i) // j = i * 2 will not affect performance too much, may alter in
														// modified sieve
						isComposite[j] = 1;
			}
	}

	static ArrayList<Integer> primeFactors(int N) // O(sqrt(N) / ln sqrt(N))
	{
		ArrayList<Integer> factors = new ArrayList<Integer>(); // take abs(N) in case of -ve integers
		int idx = 0, p = primes.get(idx);

		while (p * p <= N) {
			while (N % p == 0) {
				factors.add(p);
				N /= p;
			}
			p = primes.get(++idx);
		}

		if (N != 1) // last prime factor may be > sqrt(N)
			factors.add(N); // for integers whose largest prime factor has a power of 1
		return factors;
	}

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(System.out);
		int t = Integer.parseInt(br.readLine());

		while (t-- > 0) {
			int n = Integer.parseInt(br.readLine());
			if((n/2)%2==1)
				pw.println("NO");
			else {
				pw.println("YES");
				int sum=0;
				for (int i = 1; i <= n/2; i++) {
					pw.print(i*2+" ");
					sum+=i*2;
				}
				for (int i = 1; i < n/2; i++) {
					pw.print(i*2-1+" ");
				}
				pw.print(sum-pow(n/2-1, 2));
				pw.println();
			}

		}

		pw.flush();
		pw.close();

	}

	static boolean[] vis;
	static int[] q;
	static int[] v;
	static boolean f;
	static ArrayList<Integer>[] g;

	static long dfs(int node, long sum, int par) {
		vis[node] = true;
		if (par % 2 == 0) {
			if (g[node].size() == 1) {
				return 0;
			} else {
				long min = (int) 1e9;
				long s = 0;
				for (int x : g[node]) {
					if (!vis[x]) {
						min = Math.min(min, v[x] - sum);
					}
				}
//				System.out.println(min);
				for (int x : g[node]) {
					if (!vis[x]) {
						f &= v[x] >= sum;
						s += dfs(x, sum + min, par + 1);
					}
				}
				return s + min;
			}
		} else {
			long s = v[node] - sum;
//			System.out.println(node + " " + s);
			f &= v[node] >= sum;
			for (int x : g[node]) {
				if (!vis[x])
					s += dfs(x, v[node], par + 1);
			}
			return s;
		}
	}

	static boolean valid(int x) {
		return x >= 0 && x < n;
	}

	static void permute(pair[] a, int msk, String s, int l, int c) {
		if (msk == (1 << n) - 1) {
			ans = s;
			return;
		}
		for (int i = 0; i < n; i++) {
			if (((msk >> i) & 1) == 0) {
				if (c == 0) {
					if (a[i].x == a[l].y)
						permute(a, msk | 1 << i, s + (i + 1) + "a", i, 0);
					if (a[i].y == a[l].y)
						permute(a, msk | 1 << i, s + (i + 1) + "b", i, 1);
				} else {
					if (a[i].x == a[l].x)
						permute(a, msk | 1 << i, s + (i + 1) + "a", i, 0);
					if (a[i].y == a[l].x)
						permute(a, msk | 1 << i, s + (i + 1) + "b", i, 1);
				}

			}
		}
	}

	static int x;
	static int maxCount;
	static List<Integer> adj[];

	// Sets maxCount as maximum distance
	// from node
	static void dfsUtil(int node, int count, boolean visited[], List<Integer> adj[]) {
		visited[node] = true;
		count++;

		List<Integer> l = adj[node];
		for (Integer i : l) {
			if (!visited[i]) {
				if (count >= maxCount) {
					maxCount = count;
					x = i;
				}
				dfsUtil(i, count, visited, adj);
			}
		}
	}

	// The function to do DFS traversal. It uses
	// recursive dfsUtil()
	static void dfs(int node, int n, List<Integer> adj[]) {
		boolean[] visited = new boolean[n + 1];
		int count = 0;

		// Mark all the vertices as not visited
		Arrays.fill(visited, false);

		// Increment count by 1 for visited node
		dfsUtil(node, count + 1, visited, adj);

	}

	// Returns diameter of binary tree represented
	// as adjacency list.
	static int diameter(ArrayList<Integer> adj[], int n) {
		maxCount = Integer.MIN_VALUE;

		/*
		 * DFS from a random node and then see farthest node X from it
		 */
		dfs(1, n, adj);

		/*
		 * DFS from X and check the farthest node from it
		 */
		dfs(x, n, adj);

		return maxCount;
	}

	static class Polygon {
		// Cases to handle: collinear points, polygons with n < 3

		static final double EPS = 1e-9;

		Point[] g; // first point = last point, counter-clockwise representation

		Polygon(Point[] o) {
			g = o;
		}

		double perimeter() {
			double sum = 0.0;
			for (int i = 0; i < g.length - 1; ++i)
				sum += g[i].dist(g[i + 1]);
			return sum;
		}

		double area() // clockwise/anti-clockwise check, for convex/concave polygons
		{
			double area = 0.0;
			for (int i = 0; i < g.length - 1; ++i)
				area += g[i].x * g[i + 1].y - g[i].y * g[i + 1].x;
			return Math.abs(area) / 2.0; // negative value in case of clockwise
		}

		public static Polygon convexHull(Point[] points) // all points are unique, remove duplicates, edit ccw to accept
		// collinear points
		{
			int n = points.length;
			Arrays.sort(points);
			Point[] ans = new Point[n << 1];
			int size = 0, start = 0;

			for (int i = 0; i < n; i++) {
				Point p = points[i];
				while (size - start >= 2 && !Point.ccw(ans[size - 2], ans[size - 1], p))
					--size;
				ans[size++] = p;
			}
			start = --size;

			for (int i = n - 1; i >= 0; i--) {
				Point p = points[i];
				while (size - start >= 2 && !Point.ccw(ans[size - 2], ans[size - 1], p))
					--size;
				ans[size++] = p;
			}
			// if(size < 0) size = 0 for empty set of points
			return new Polygon(Arrays.copyOf(ans, size));
		}
	}

	static class Point implements Comparable<Point> {

		static final double EPS = 1e-9;

		double x, y;

		Point(double a, double b) {
			x = a;
			y = b;
		}

		static double angle(Point a, Point o, Point b) // angle AOB
		{
			Vector oa = new Vector(o, a), ob = new Vector(o, b);
			return Math.acos(oa.dot(ob) / Math.sqrt(oa.norm2() * ob.norm2()));
		}

		public int compareTo(Point p) {
			if (Math.abs(x - p.x) > EPS)
				return x > p.x ? 1 : -1;
			if (Math.abs(y - p.y) > EPS)
				return y > p.y ? 1 : -1;
			return 0;
		}

		public double dist(Point p) {
			return Math.sqrt(sq(x - p.x) + sq(y - p.y));
		}

		static double sq(double x) {
			return x * x;
		}

		Point rotate(double angle) {
			double c = Math.cos(angle), s = Math.sin(angle);
			return new Point(x * c - y * s, x * s + y * c);
		}

		// for integer points and rotation by 90 (counterclockwise) : swap x and y,
		// negate x
		static boolean ccw(Point p, Point q, Point r) {
			return new Vector(p, q).cross(new Vector(p, r)) > 0;
		}

		static double distToLine(Point p, Point a, Point b) // distance between point p and a line defined by points a,
															// b (a != b)
		{
			if (a.compareTo(b) == 0)
				return p.dist(a);
			// formula: c = a + u * ab
			Vector ap = new Vector(a, p), ab = new Vector(a, b);
			double u = ap.dot(ab) / ab.norm2();
			Point c = a.translate(ab.scale(u));
			return p.dist(c);
		}

		Point translate(Vector v) {
			return new Point(x + v.x, y + v.y);
		}

	}

	static class Vector {

		double x, y;

		Vector(double a, double b) {
			x = a;
			y = b;
		}

		Vector(Point a, Point b) {
			this(b.x - a.x, b.y - a.y);
		}

		Vector scale(double s) {
			return new Vector(x * s, y * s);
		} // s is a non-negative value

		double dot(Vector v) {
			return (x * v.x + y * v.y);
		}

		double cross(Vector v) {
			return x * v.y - y * v.x;
		}

		double norm2() {
			return x * x + y * y;
		}

		Vector reverse() {
			return new Vector(-x, -y);
		}

		Vector normalize() {
			double d = Math.sqrt(norm2());
			return scale(1 / d);
		}
	}

	static class pair implements Comparable<pair> {
		int x;
		int y;

		public pair(int d, int u) {
			x = d;
			y = u;
		}

		public int compareTo(pair o) {
			return y - o.y;
		}

	}

	static class triple implements Comparable<triple> {
		int x;
		int y;
		int z;

		public triple(int a, int b, int c) {
			x = a;
			y = b;
			z = c;
		}

		public int compareTo(triple o) {
			return x - o.x;
		}
	}

	static int[] nxtarr() throws IOException {
		StringTokenizer st = new StringTokenizer(br.readLine());
		int[] a = new int[st.countTokens()];
		for (int i = 0; i < a.length; i++) {
			a[i] = Integer.parseInt(st.nextToken());
		}
		return a;
	}

	static long pow(long a, long e) // O(log e)
	{
		long res = 1;
		while (e > 0) {
			if ((e & 1) == 1)
				res *= a;
			a *= a;
			e >>= 1;
		}
		return res;
	}

	static int gcd(int a, int b) {
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}
}


import java.util.*;

import java.io.*;
import java.math.BigInteger;

public class A {

	static BufferedReader br;
	static PrintWriter pw;
	static int inf = (int) 1e9;
	static long mod = (long) 1e9 + 7;

	static String ans;

	static int n, k;

	static ArrayList<Integer> primes;
	static int[] isComposite;

	static void sieve(int N) // O(N log log N)
	{
		isComposite = new int[N + 1];
		isComposite[0] = isComposite[1] = 1; // 0 indicates a prime number
		primes = new ArrayList<Integer>();

		for (int i = 2; i <= N; ++i) // can loop till i*i <= N if primes array is not needed O(N log log sqrt(N))
			if (isComposite[i] == 0) // can loop in 2 and odd integers for slightly better performance
			{
				primes.add(i);
				if (1l * i * i <= N)
					for (int j = i * i; j <= N; j += i) // j = i * 2 will not affect performance too much, may alter in
														// modified sieve
						isComposite[j] = 1;
			}
	}

	static ArrayList<Integer> primeFactors(int N) // O(sqrt(N) / ln sqrt(N))
	{
		ArrayList<Integer> factors = new ArrayList<Integer>(); // take abs(N) in case of -ve integers
		int idx = 0, p = primes.get(idx);

		while (p * p <= N) {
			while (N % p == 0) {
				factors.add(p);
				N /= p;
			}
			p = primes.get(++idx);
		}

		if (N != 1) // last prime factor may be > sqrt(N)
			factors.add(N); // for integers whose largest prime factor has a power of 1
		return factors;
	}

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(System.out);
		int t = Integer.parseInt(br.readLine());

		while (t-- > 0) {
			int n = Integer.parseInt(br.readLine());
			if((n/2)%2==1)
				pw.println("NO");
			else {
				pw.println("YES");
				long sum=0;
				for (int i = 1; i <= n/2; i++) {
					pw.print(i*2+" ");
					sum+=i*2;
				}
				for (int i = 1; i < n/2; i++) {
					pw.print(i*2-1+" ");
				}
				pw.print(sum-pow(n/2-1, 2));
				pw.println();
			}

		}

		pw.flush();
		pw.close();

	}

	static boolean[] vis;
	static int[] q;
	static int[] v;
	static boolean f;
	static ArrayList<Integer>[] g;

	static long dfs(int node, long sum, int par) {
		vis[node] = true;
		if (par % 2 == 0) {
			if (g[node].size() == 1) {
				return 0;
			} else {
				long min = (int) 1e9;
				long s = 0;
				for (int x : g[node]) {
					if (!vis[x]) {
						min = Math.min(min, v[x] - sum);
					}
				}
//				System.out.println(min);
				for (int x : g[node]) {
					if (!vis[x]) {
						f &= v[x] >= sum;
						s += dfs(x, sum + min, par + 1);
					}
				}
				return s + min;
			}
		} else {
			long s = v[node] - sum;
//			System.out.println(node + " " + s);
			f &= v[node] >= sum;
			for (int x : g[node]) {
				if (!vis[x])
					s += dfs(x, v[node], par + 1);
			}
			return s;
		}
	}

	static boolean valid(int x) {
		return x >= 0 && x < n;
	}

	static void permute(pair[] a, int msk, String s, int l, int c) {
		if (msk == (1 << n) - 1) {
			ans = s;
			return;
		}
		for (int i = 0; i < n; i++) {
			if (((msk >> i) & 1) == 0) {
				if (c == 0) {
					if (a[i].x == a[l].y)
						permute(a, msk | 1 << i, s + (i + 1) + "a", i, 0);
					if (a[i].y == a[l].y)
						permute(a, msk | 1 << i, s + (i + 1) + "b", i, 1);
				} else {
					if (a[i].x == a[l].x)
						permute(a, msk | 1 << i, s + (i + 1) + "a", i, 0);
					if (a[i].y == a[l].x)
						permute(a, msk | 1 << i, s + (i + 1) + "b", i, 1);
				}

			}
		}
	}

	static int x;
	static int maxCount;
	static List<Integer> adj[];

	// Sets maxCount as maximum distance
	// from node
	static void dfsUtil(int node, int count, boolean visited[], List<Integer> adj[]) {
		visited[node] = true;
		count++;

		List<Integer> l = adj[node];
		for (Integer i : l) {
			if (!visited[i]) {
				if (count >= maxCount) {
					maxCount = count;
					x = i;
				}
				dfsUtil(i, count, visited, adj);
			}
		}
	}

	// The function to do DFS traversal. It uses
	// recursive dfsUtil()
	static void dfs(int node, int n, List<Integer> adj[]) {
		boolean[] visited = new boolean[n + 1];
		int count = 0;

		// Mark all the vertices as not visited
		Arrays.fill(visited, false);

		// Increment count by 1 for visited node
		dfsUtil(node, count + 1, visited, adj);

	}

	// Returns diameter of binary tree represented
	// as adjacency list.
	static int diameter(ArrayList<Integer> adj[], int n) {
		maxCount = Integer.MIN_VALUE;

		/*
		 * DFS from a random node and then see farthest node X from it
		 */
		dfs(1, n, adj);

		/*
		 * DFS from X and check the farthest node from it
		 */
		dfs(x, n, adj);

		return maxCount;
	}

	static class Polygon {
		// Cases to handle: collinear points, polygons with n < 3

		static final double EPS = 1e-9;

		Point[] g; // first point = last point, counter-clockwise representation

		Polygon(Point[] o) {
			g = o;
		}

		double perimeter() {
			double sum = 0.0;
			for (int i = 0; i < g.length - 1; ++i)
				sum += g[i].dist(g[i + 1]);
			return sum;
		}

		double area() // clockwise/anti-clockwise check, for convex/concave polygons
		{
			double area = 0.0;
			for (int i = 0; i < g.length - 1; ++i)
				area += g[i].x * g[i + 1].y - g[i].y * g[i + 1].x;
			return Math.abs(area) / 2.0; // negative value in case of clockwise
		}

		public static Polygon convexHull(Point[] points) // all points are unique, remove duplicates, edit ccw to accept
		// collinear points
		{
			int n = points.length;
			Arrays.sort(points);
			Point[] ans = new Point[n << 1];
			int size = 0, start = 0;

			for (int i = 0; i < n; i++) {
				Point p = points[i];
				while (size - start >= 2 && !Point.ccw(ans[size - 2], ans[size - 1], p))
					--size;
				ans[size++] = p;
			}
			start = --size;

			for (int i = n - 1; i >= 0; i--) {
				Point p = points[i];
				while (size - start >= 2 && !Point.ccw(ans[size - 2], ans[size - 1], p))
					--size;
				ans[size++] = p;
			}
			// if(size < 0) size = 0 for empty set of points
			return new Polygon(Arrays.copyOf(ans, size));
		}
	}

	static class Point implements Comparable<Point> {

		static final double EPS = 1e-9;

		double x, y;

		Point(double a, double b) {
			x = a;
			y = b;
		}

		static double angle(Point a, Point o, Point b) // angle AOB
		{
			Vector oa = new Vector(o, a), ob = new Vector(o, b);
			return Math.acos(oa.dot(ob) / Math.sqrt(oa.norm2() * ob.norm2()));
		}

		public int compareTo(Point p) {
			if (Math.abs(x - p.x) > EPS)
				return x > p.x ? 1 : -1;
			if (Math.abs(y - p.y) > EPS)
				return y > p.y ? 1 : -1;
			return 0;
		}

		public double dist(Point p) {
			return Math.sqrt(sq(x - p.x) + sq(y - p.y));
		}

		static double sq(double x) {
			return x * x;
		}

		Point rotate(double angle) {
			double c = Math.cos(angle), s = Math.sin(angle);
			return new Point(x * c - y * s, x * s + y * c);
		}

		// for integer points and rotation by 90 (counterclockwise) : swap x and y,
		// negate x
		static boolean ccw(Point p, Point q, Point r) {
			return new Vector(p, q).cross(new Vector(p, r)) > 0;
		}

		static double distToLine(Point p, Point a, Point b) // distance between point p and a line defined by points a,
															// b (a != b)
		{
			if (a.compareTo(b) == 0)
				return p.dist(a);
			// formula: c = a + u * ab
			Vector ap = new Vector(a, p), ab = new Vector(a, b);
			double u = ap.dot(ab) / ab.norm2();
			Point c = a.translate(ab.scale(u));
			return p.dist(c);
		}

		Point translate(Vector v) {
			return new Point(x + v.x, y + v.y);
		}

	}

	static class Vector {

		double x, y;

		Vector(double a, double b) {
			x = a;
			y = b;
		}

		Vector(Point a, Point b) {
			this(b.x - a.x, b.y - a.y);
		}

		Vector scale(double s) {
			return new Vector(x * s, y * s);
		} // s is a non-negative value

		double dot(Vector v) {
			return (x * v.x + y * v.y);
		}

		double cross(Vector v) {
			return x * v.y - y * v.x;
		}

		double norm2() {
			return x * x + y * y;
		}

		Vector reverse() {
			return new Vector(-x, -y);
		}

		Vector normalize() {
			double d = Math.sqrt(norm2());
			return scale(1 / d);
		}
	}

	static class pair implements Comparable<pair> {
		int x;
		int y;

		public pair(int d, int u) {
			x = d;
			y = u;
		}

		public int compareTo(pair o) {
			return y - o.y;
		}

	}

	static class triple implements Comparable<triple> {
		int x;
		int y;
		int z;

		public triple(int a, int b, int c) {
			x = a;
			y = b;
			z = c;
		}

		public int compareTo(triple o) {
			return x - o.x;
		}
	}

	static int[] nxtarr() throws IOException {
		StringTokenizer st = new StringTokenizer(br.readLine());
		int[] a = new int[st.countTokens()];
		for (int i = 0; i < a.length; i++) {
			a[i] = Integer.parseInt(st.nextToken());
		}
		return a;
	}

	static long pow(long a, long e) // O(log e)
	{
		long res = 1;
		while (e > 0) {
			if ((e & 1) == 1)
				res *= a;
			a *= a;
			e >>= 1;
		}
		return res;
	}

	static int gcd(int a, int b) {
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}
}


import java.util.*;

import java.io.*;
import java.math.BigInteger;

public class A {

	static BufferedReader br;
	static PrintWriter pw;
	static int inf = (int) 1e9;
	static long mod = (long) 1e9 + 7;

	static String ans;

	static int n, k;

	static ArrayList<Integer> primes;
	static int[] isComposite;

	static void sieve(int N) // O(N log log N)
	{
		isComposite = new int[N + 1];
		isComposite[0] = isComposite[1] = 1; // 0 indicates a prime number
		primes = new ArrayList<Integer>();

		for (int i = 2; i <= N; ++i) // can loop till i*i <= N if primes array is not needed O(N log log sqrt(N))
			if (isComposite[i] == 0) // can loop in 2 and odd integers for slightly better performance
			{
				primes.add(i);
				if (1l * i * i <= N)
					for (int j = i * i; j <= N; j += i) // j = i * 2 will not affect performance too much, may alter in
														// modified sieve
						isComposite[j] = 1;
			}
	}

	static ArrayList<Integer> primeFactors(int N) // O(sqrt(N) / ln sqrt(N))
	{
		ArrayList<Integer> factors = new ArrayList<Integer>(); // take abs(N) in case of -ve integers
		int idx = 0, p = primes.get(idx);

		while (p * p <= N) {
			while (N % p == 0) {
				factors.add(p);
				N /= p;
			}
			p = primes.get(++idx);
		}

		if (N != 1) // last prime factor may be > sqrt(N)
			factors.add(N); // for integers whose largest prime factor has a power of 1
		return factors;
	}

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(System.out);
		int t = Integer.parseInt(br.readLine());

		while (t-- > 0) {
			int n = Integer.parseInt(br.readLine());
			if((n/2)%2==1)
				pw.println("NO");
			else {
				pw.println("YES");
				for (int i = 1; i <= n/2; i++) {
					pw.print(i*2+" ");
				}
				for (int i = 1; i <= n/2; i++) {
					pw.print(i*2-1+" ");
				}
				pw.println();
			}

		}

		pw.flush();
		pw.close();

	}

	static boolean[] vis;
	static int[] q;
	static int[] v;
	static boolean f;
	static ArrayList<Integer>[] g;

	static long dfs(int node, long sum, int par) {
		vis[node] = true;
		if (par % 2 == 0) {
			if (g[node].size() == 1) {
				return 0;
			} else {
				long min = (int) 1e9;
				long s = 0;
				for (int x : g[node]) {
					if (!vis[x]) {
						min = Math.min(min, v[x] - sum);
					}
				}
//				System.out.println(min);
				for (int x : g[node]) {
					if (!vis[x]) {
						f &= v[x] >= sum;
						s += dfs(x, sum + min, par + 1);
					}
				}
				return s + min;
			}
		} else {
			long s = v[node] - sum;
//			System.out.println(node + " " + s);
			f &= v[node] >= sum;
			for (int x : g[node]) {
				if (!vis[x])
					s += dfs(x, v[node], par + 1);
			}
			return s;
		}
	}

	static boolean valid(int x) {
		return x >= 0 && x < n;
	}

	static void permute(pair[] a, int msk, String s, int l, int c) {
		if (msk == (1 << n) - 1) {
			ans = s;
			return;
		}
		for (int i = 0; i < n; i++) {
			if (((msk >> i) & 1) == 0) {
				if (c == 0) {
					if (a[i].x == a[l].y)
						permute(a, msk | 1 << i, s + (i + 1) + "a", i, 0);
					if (a[i].y == a[l].y)
						permute(a, msk | 1 << i, s + (i + 1) + "b", i, 1);
				} else {
					if (a[i].x == a[l].x)
						permute(a, msk | 1 << i, s + (i + 1) + "a", i, 0);
					if (a[i].y == a[l].x)
						permute(a, msk | 1 << i, s + (i + 1) + "b", i, 1);
				}

			}
		}
	}

	static int x;
	static int maxCount;
	static List<Integer> adj[];

	// Sets maxCount as maximum distance
	// from node
	static void dfsUtil(int node, int count, boolean visited[], List<Integer> adj[]) {
		visited[node] = true;
		count++;

		List<Integer> l = adj[node];
		for (Integer i : l) {
			if (!visited[i]) {
				if (count >= maxCount) {
					maxCount = count;
					x = i;
				}
				dfsUtil(i, count, visited, adj);
			}
		}
	}

	// The function to do DFS traversal. It uses
	// recursive dfsUtil()
	static void dfs(int node, int n, List<Integer> adj[]) {
		boolean[] visited = new boolean[n + 1];
		int count = 0;

		// Mark all the vertices as not visited
		Arrays.fill(visited, false);

		// Increment count by 1 for visited node
		dfsUtil(node, count + 1, visited, adj);

	}

	// Returns diameter of binary tree represented
	// as adjacency list.
	static int diameter(ArrayList<Integer> adj[], int n) {
		maxCount = Integer.MIN_VALUE;

		/*
		 * DFS from a random node and then see farthest node X from it
		 */
		dfs(1, n, adj);

		/*
		 * DFS from X and check the farthest node from it
		 */
		dfs(x, n, adj);

		return maxCount;
	}

	static class Polygon {
		// Cases to handle: collinear points, polygons with n < 3

		static final double EPS = 1e-9;

		Point[] g; // first point = last point, counter-clockwise representation

		Polygon(Point[] o) {
			g = o;
		}

		double perimeter() {
			double sum = 0.0;
			for (int i = 0; i < g.length - 1; ++i)
				sum += g[i].dist(g[i + 1]);
			return sum;
		}

		double area() // clockwise/anti-clockwise check, for convex/concave polygons
		{
			double area = 0.0;
			for (int i = 0; i < g.length - 1; ++i)
				area += g[i].x * g[i + 1].y - g[i].y * g[i + 1].x;
			return Math.abs(area) / 2.0; // negative value in case of clockwise
		}

		public static Polygon convexHull(Point[] points) // all points are unique, remove duplicates, edit ccw to accept
		// collinear points
		{
			int n = points.length;
			Arrays.sort(points);
			Point[] ans = new Point[n << 1];
			int size = 0, start = 0;

			for (int i = 0; i < n; i++) {
				Point p = points[i];
				while (size - start >= 2 && !Point.ccw(ans[size - 2], ans[size - 1], p))
					--size;
				ans[size++] = p;
			}
			start = --size;

			for (int i = n - 1; i >= 0; i--) {
				Point p = points[i];
				while (size - start >= 2 && !Point.ccw(ans[size - 2], ans[size - 1], p))
					--size;
				ans[size++] = p;
			}
			// if(size < 0) size = 0 for empty set of points
			return new Polygon(Arrays.copyOf(ans, size));
		}
	}

	static class Point implements Comparable<Point> {

		static final double EPS = 1e-9;

		double x, y;

		Point(double a, double b) {
			x = a;
			y = b;
		}

		static double angle(Point a, Point o, Point b) // angle AOB
		{
			Vector oa = new Vector(o, a), ob = new Vector(o, b);
			return Math.acos(oa.dot(ob) / Math.sqrt(oa.norm2() * ob.norm2()));
		}

		public int compareTo(Point p) {
			if (Math.abs(x - p.x) > EPS)
				return x > p.x ? 1 : -1;
			if (Math.abs(y - p.y) > EPS)
				return y > p.y ? 1 : -1;
			return 0;
		}

		public double dist(Point p) {
			return Math.sqrt(sq(x - p.x) + sq(y - p.y));
		}

		static double sq(double x) {
			return x * x;
		}

		Point rotate(double angle) {
			double c = Math.cos(angle), s = Math.sin(angle);
			return new Point(x * c - y * s, x * s + y * c);
		}

		// for integer points and rotation by 90 (counterclockwise) : swap x and y,
		// negate x
		static boolean ccw(Point p, Point q, Point r) {
			return new Vector(p, q).cross(new Vector(p, r)) > 0;
		}

		static double distToLine(Point p, Point a, Point b) // distance between point p and a line defined by points a,
															// b (a != b)
		{
			if (a.compareTo(b) == 0)
				return p.dist(a);
			// formula: c = a + u * ab
			Vector ap = new Vector(a, p), ab = new Vector(a, b);
			double u = ap.dot(ab) / ab.norm2();
			Point c = a.translate(ab.scale(u));
			return p.dist(c);
		}

		Point translate(Vector v) {
			return new Point(x + v.x, y + v.y);
		}

	}

	static class Vector {

		double x, y;

		Vector(double a, double b) {
			x = a;
			y = b;
		}

		Vector(Point a, Point b) {
			this(b.x - a.x, b.y - a.y);
		}

		Vector scale(double s) {
			return new Vector(x * s, y * s);
		} // s is a non-negative value

		double dot(Vector v) {
			return (x * v.x + y * v.y);
		}

		double cross(Vector v) {
			return x * v.y - y * v.x;
		}

		double norm2() {
			return x * x + y * y;
		}

		Vector reverse() {
			return new Vector(-x, -y);
		}

		Vector normalize() {
			double d = Math.sqrt(norm2());
			return scale(1 / d);
		}
	}

	static class pair implements Comparable<pair> {
		int x;
		int y;

		public pair(int d, int u) {
			x = d;
			y = u;
		}

		public int compareTo(pair o) {
			return y - o.y;
		}

	}

	static class triple implements Comparable<triple> {
		int x;
		int y;
		int z;

		public triple(int a, int b, int c) {
			x = a;
			y = b;
			z = c;
		}

		public int compareTo(triple o) {
			return x - o.x;
		}
	}

	static int[] nxtarr() throws IOException {
		StringTokenizer st = new StringTokenizer(br.readLine());
		int[] a = new int[st.countTokens()];
		for (int i = 0; i < a.length; i++) {
			a[i] = Integer.parseInt(st.nextToken());
		}
		return a;
	}

	static long pow(long a, long e) // O(log e)
	{
		long res = 1;
		while (e > 0) {
			if ((e & 1) == 1)
				res *= a;
			a *= a;
			e >>= 1;
		}
		return res;
	}

	static int gcd(int a, int b) {
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}
}


import java.io.*;
import java.util.*;
public class File
{
	public static void main(String[] args)
	{
	    Scanner sc=new Scanner(System.in);
	    int t=sc.nextInt();
	    int val=2*100000;
	    ArrayList<Integer> a1=new ArrayList<Integer>();
	    for(int i=2;i<=val;i=i+2)
	    {
	        a1.add(i);
	    }
	    ArrayList<Integer> a2=new ArrayList<Integer>();
	    for(int i=1;i<=val;i=i+2)
	    {
	        a2.add(i);
	    }
	    while(t-->0)
	    {
	        int n=sc.nextInt();
	        int p=n/2;
	        if(p%2!=0)
	            System.out.println("NO");
	        else
	        {
	            System.out.println("Yes");
	            int sum=0;
	            for(int i=0;i<p;i++)
	            {
	                System.out.print(a1.get(i)+" ");
	                sum+=a1.get(i);
	            }
	            int sum2=0;
	            for(int i=0;i<p-1;i++)
	            {
	                System.out.print(a2.get(i)+" ");
	                sum2+=a2.get(i);
	            }
	            System.out.print((sum-sum2)+"\n");
	        }
	    }
	}
//bw.flush();
}


import java.io.*;
import java.util.*;
public class File
{
	public static void main(String[] args)
	{
	    Scanner sc=new Scanner(System.in);
	    int t=sc.nextInt();
	    int val=2*100000;
	    ArrayList<Integer> a1=new ArrayList<Integer>();
	    for(int i=2;i<=val;i=i+2)
	    {
	        a1.add(i);
	    }
	    ArrayList<Integer> a2=new ArrayList<Integer>();
	    for(int i=1;i<=val;i=i+2)
	    {
	        a2.add(i);
	    }
	    while(t-->0)
	    {
	        int n=sc.nextInt();
	        int p=n/2;
	        if(p%2!=0)
	            System.out.println("NO");
	        else
	        {
	            int sum=0;
	            for(int i=0;i<p;i++)
	            {
	                System.out.print(a1.get(i)+" ");
	                sum+=a.get(i);
	            }
	            int sum2=0;
	            for(int i=0;i<p-1;i++)
	            {
	                System.out.print(a2.get(i)+" ")
	                sum2+=a2.get(i);
	            }
	            System.out.print(sum-sum2+"\n");
	        }
	    }
	}
//bw.flush();
}


import java.io.*;
import java.util.*;
public class File
{
	public static void main(String[] args)
	{
	    Scanner sc=new Scanner(System.in);
	    int t=sc.nextInt();
	    int val=2*100000;
	    ArrayList<Integer> a1=new ArrayList<Integer>();
	    for(int i=2;i<=val;i=i+2)
	    {
	        a1.add(i);
	    }
	    ArrayList<Integer> a2=new ArrayList<Integer>();
	    for(int i=1;i<=val;i=i+2)
	    {
	        a2.add(i);
	    }
	    while(t-->0)
	    {
	        int n=sc.nextInt();
	        int p=n/2;
	        if(p%2!=0)
	            System.out.println("NO");
	        else
	        {
	            int sum=0;
	            for(int i=0;i<p;i++)
	            {
	                System.out.print(a1.get(i)+" ");
	                sum+=a1.get(i);
	            }
	            int sum2=0;
	            for(int i=0;i<p-1;i++)
	            {
	                System.out.print(a2.get(i)+" ");
	                sum2+=a2.get(i);
	            }
	            System.out.print((sum-sum2)+"\n");
	        }
	    }
	}
//bw.flush();
}


import java.util.*;
public class balance
{
	public static void main(String ar[])
	{
		Scanner scan= new Scanner(System.in);
		int test=scan.nextInt();
		while(test-->0)
		{
			int n=scan.nextInt();

			if(n%4!=0)
				System.out.println("NO");
			else{//long sume=(n/4)*(4+((n/2)-1)*2);
			//long sumo=(n/4)*(2+(((n/2)-1)-1))*2;
			System.out.println("YES");
			long sume=2,sum1=0;
			for(int i=0;i<(n/2);i++)
			{	System.out.print(sume+" ");
			    sum1+=sume;
				sume+=2;
			}
			long sumo=1,sum2=0;
			for(int i=0;i<(n/2)-1;i++)
			{
			    sum2+=sumo;
				System.out.print(sumo+" ");
				sumo+=2;
			}
			System.out.print(sum1-sum2);
			System.out.println("");
			}
		}
	}
}


import java.util.*;
public class balance
{
	public static void main(String ar[])
	{
		Scanner scan= new Scanner(System.in);
		int test=scan.nextInt();
		while(test-->0)
		{
			int n=scan.nextInt();

			if(n%4!=0)
				System.out.println("NO");
			else{//long sume=(n/4)*(4+((n/2)-1)*2);
			//long sumo=(n/4)*(2+(((n/2)-1)-1))*2;
			long sume=2,sum1=0;
			for(int i=0;i<(n/2);i++)
			{	System.out.print(sume+" ");
			    sum1+=sume
				sume+=2;
			}
			long sumo=1,sum2=0;
			for(int i=0;i<(n/2)-1;i++)
			{
			    sum2+=sumo;
				System.out.print(sumo+" ");
				sumo+=2;
			}
			System.out.print(sum1-sum2);
			System.out.println("");
			}
		}
	}
}


import java.util.*;
public class balance
{
	public static void main(String ar[])
	{
		Scanner scan= new Scanner(System.in);
		int test=scan.nextInt();
		while(test-->0)
		{
			int n=scan.nextInt();

			if(n%4!=0)
				System.out.println("NO");
			else{//long sume=(n/4)*(4+((n/2)-1)*2);
			//long sumo=(n/4)*(2+(((n/2)-1)-1))*2;
			long sume=2;
			for(int i=0;i<(n/2);i++)
			{	System.out.print(sume+" ");
				sume+=2;
			}
			long sumo=1;
			for(int i=0;i<(n/2)-1;i++)
			{
				System.out.print(sumo+" ");
				sumo+=2;
			}
			System.out.print(sume-sumo);
			System.out.println("");
			}
		}
	}
}


import java.util.*;
public class balance
{
	public static void main(String ar[])
	{
		Scanner scan= new Scanner(System.in);
		int test=scan.nextInt();
		while(test-->0)
		{
			int n=scan.nextInt();

			if(n%4!=0)
				System.out.println("NO");
			else{//long sume=(n/4)*(4+((n/2)-1)*2);
			//long sumo=(n/4)*(2+(((n/2)-1)-1))*2;
			long sume=2;
			for(int i=0;i<(n/2);i++)
			{	System.out.print(sume+" ");
				sume+=2;
			}
			long sumo=1;
			for(int i=0;i<(n/2)-1;i++)
			{
				System.out.print(sumo+" ");
				sumo+=2;
			}
			System.out.print(sume-sumo);
			}
		}
	}
}


import java.util.*;
public class balance
{
	public static void main(String ar[])
	{
		Scanner scan= new Scanner(System.in);
		int test=scan.nextInt();
		while(test-->0)
		{
			int n=scan.nextInt();

			if(n%4!=0)
				System.out.println("NO");
			else{//long sume=(n/4)*(4+((n/2)-1)*2);
			//long sumo=(n/4)*(2+(((n/2)-1)-1))*2;
			long sume=2,sum1=0;
			for(int i=0;i<(n/2);i++)
			{	System.out.print(sume+" ");
			    sum1+=sume;
				sume+=2;
			}
			long sumo=1,sum2=0;
			for(int i=0;i<(n/2)-1;i++)
			{
			    sum2+=sumo;
				System.out.print(sumo+" ");
				sumo+=2;
			}
			System.out.print(sum1-sum2);
			System.out.println("");
			}
		}
	}
}


import java.util.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main {
  public static void main(String[] args) throws java.lang.Exception {
    Scanner in = new Scanner(System.in);
    Integer testcases = in.nextInt();
    ArrayList<Integer> list = new ArrayList<>();

    for (int i = 0; i < testcases; i++) {
      list.add(in.nextInt());
    }

    ArrayList<Integer> evenlist = new ArrayList<>();
    ArrayList<Integer> oddlist = new ArrayList<>();
    StringBuilder str = new StringBuilder();
    for (int i = 0; i < list.size(); i++) {
      Integer n = list.get(i) / 2;
      if (n % 2 != 0) {
        System.out.println("NO");
      } else if (n % 2 == 0) {

        for (int j = 1; j <= list.get(i); j = j + 2) {
          oddlist.add(j);
        }
        for (int j = 2; j <= list.get(i); j = j + 2) {
          evenlist.add(j);
        }
        Integer evensum = 0;
        for (int j = 0; j < evenlist.size(); j++) {
          evensum += evenlist.get(j);
        }
        Integer oddsum = 0;
        for (int j = 0; j < oddlist.size(); j++) {
          oddsum += oddlist.get(j);
        }
        Integer difference = evensum - oddsum;
        oddlist.set(oddlist.size() - 1, oddlist.get(oddlist.size() - 1) + difference);
        for (int j = 0; j < evenlist.size(); j++) {
          str.append(evenlist.get(j) + " ");
        }
        for (int j = 0; j < oddlist.size(); j++) {
          str.append(oddlist.get(j) + " ");
        }
        System.out.println("YES");
        System.out.println(str);
      }

    }

  }
}


import java.util.*;

import org.graalvm.compiler.loop.MathUtil;

/* Name of the class has to be "Main" only if the class is public. */
public class Main {
  public static void main(String[] args) throws java.lang.Exception {
    Scanner in = new Scanner(System.in);
    Integer testcases = in.nextInt();
    ArrayList<Integer> list = new ArrayList<>();

    for (int i = 0; i < testcases; i++) {
      list.add(in.nextInt());
    }

    ArrayList<Integer> evenlist = new ArrayList<>();
    ArrayList<Integer> oddlist = new ArrayList<>();
    StringBuilder str = new StringBuilder();
    for (int i = 0; i < list.size(); i++) {
      Integer n = list.get(i) / 2;
      if (n % 2 != 0) {
        System.out.println("NO");
      } else if (n % 2 == 0) {

        for (int j = 1; j <= list.get(i); j = j + 2) {
          oddlist.add(j);
        }
        for (int j = 2; j <= list.get(i); j = j + 2) {
          evenlist.add(j);
        }
        Integer evensum = 0;
        for (int j = 0; j < evenlist.size(); j++) {
          evensum += evenlist.get(j);
        }
        Integer oddsum = 0;
        for (int j = 0; j < oddlist.size(); j++) {
          oddsum += oddlist.get(j);
        }
        Integer difference = evensum - oddsum;
        oddlist.set(oddlist.size() - 1, oddlist.get(oddlist.size() - 1) + difference);
        for (int j = 0; j < evenlist.size(); j++) {
          str.append(evenlist.get(j) + " ");
        }
        for (int j = 0; j < oddlist.size(); j++) {
          str.append(oddlist.get(j) + " ");
        }
        System.out.println("YES");
        System.out.println(str);
      }

    }

  }
}


import java.util.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main {
  public static void main(String[] args) throws java.lang.Exception {
    Scanner in = new Scanner(System.in);
    Integer testcases = in.nextInt();
    ArrayList<Integer> list = new ArrayList<>();

    for (int i = 0; i < testcases; i++) {
      list.add(in.nextInt());
    }

    ArrayList<Integer> evenlist = new ArrayList<>();
    ArrayList<Integer> oddlist = new ArrayList<>();
    StringBuilder str = new StringBuilder();
    for (int i = 0; i < list.size(); i++) {
      Integer n = list.get(i) / 2;
      if (n % 2 != 0) {
        System.out.println("NO");
      } else if (n % 2 == 0) {

        for (int j = 1; j <= list.get(i); j = j + 2) {
          oddlist.add(j);
        }
        for (int j = 2; j <= list.get(i); j = j + 2) {
          evenlist.add(j);
        }
        Integer evensum = 0;
        for (int j = 0; j < evenlist.size(); j++) {
          evensum += evenlist.get(j);
        }
        Integer oddsum = 0;
        for (int j = 0; j < oddlist.size(); j++) {
          oddsum += oddlist.get(j);
        }
        Integer difference = evensum - oddsum;
        oddlist.set(oddlist.size() - 1, oddlist.get(oddlist.size() - 1) + difference);
        for (int j = 0; j < evenlist.size(); j++) {
          str.append(evenlist.get(j) + " ");

        }
        // System.out.println(str);
        for (int j = 0; j < oddlist.size(); j++) {
          str.append(oddlist.get(j) + " ");
          // System.out.println(str);
        }
        System.out.println("YES");
        System.out.println(str);
      }

    }

  }
}


import java.util.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main {
  public static void main(String[] args) throws java.lang.Exception {
    Scanner in = new Scanner(System.in);
    Integer testcases = in.nextInt();
    ArrayList<Integer> list = new ArrayList<>();

    for (int i = 0; i < testcases; i++) {
      list.add(in.nextInt());
    }

    for (int i = 0; i < list.size(); i++) {
      Integer n = list.get(i) / 2;
      if (n % 2 != 0) {
        System.out.println("NO");
      } else if (n % 2 == 0) {
        ArrayList<Integer> evenlist = new ArrayList<>();
        ArrayList<Integer> oddlist = new ArrayList<>();
        StringBuilder str = new StringBuilder();
        for (int j = 1; j <= list.get(i); j = j + 2) {
          oddlist.add(j);
        }
        for (int j = 2; j <= list.get(i); j = j + 2) {
          evenlist.add(j);
        }
        Integer evensum = 0;
        for (int j = 0; j < evenlist.size(); j++) {
          evensum += evenlist.get(j);
        }
        Integer oddsum = 0;
        for (int j = 0; j < oddlist.size(); j++) {
          oddsum += oddlist.get(j);
        }
        Integer difference = evensum - oddsum;
        oddlist.set(oddlist.size() - 1, oddlist.get(oddlist.size() - 1) + difference);
        for (int j = 0; j < evenlist.size(); j++) {
          str.append(evenlist.get(j) + " ");

        }
        // System.out.println(str);
        for (int j = 0; j < oddlist.size(); j++) {
          str.append(oddlist.get(j) + " ");
          // System.out.println(str);
        }
        System.out.println("YES");
        System.out.println(str);
        str.delete(0, (str.length() - 1));
        // System.out.println(str.length());

      }

    }

  }
}


import java.util.Scanner;

public class Solution{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int t = sc.nextInt();
        for (int i = 0; i < t; i++) {
            int mas = sc.nextInt();
            if (mas / 2 % 2 == 1) {
                System.out.println("NO");
            }
            else {
                System.out.println("YES");
                for (int j = 0; mas / 2 > j; j++) {
                    System.out.printf("%d ", (j + 1) * 2);
                }
                for (int j = 0; mas / 2 > j; j++) {
                    if (j + 1 == mas / 2) {
                        System.out.printf("%d\n", ((j + 1) * 2 + mas / 2 - 1));
                    }
                    else {
                        System.out.printf("%d ", (j + 1) * 2 - 1);
                    }
                }
            }
        }
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class Solution{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int t = sc.nextInt();
        for (int i = 0; i < t; i++) {
            int mas = sc.nextInt();
            int[] array = new int[mas];
            if (mas / 2 % 2 == 1) {
                System.out.println("NO");
            }
            else {
                System.out.println("YES");
                for (int j = 0; mas / 2 > j; j++) {
                    array[j] = (j + 1) * 2;
                    if (j + 1 == mas / 2) {
                        array[j + mas / 2] = (j + 1) * 2 + mas / 2 - 1;
                    }
                    else {
                        array[j + mas / 2] = (j + 1) * 2 - 1;
                    }
                }
            }
            System.out.println(Arrays.toString(array).replace("[","").replace(",", "").replace("]", ""));
        }
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class Solution{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int t = sc.nextInt();
        for (int i = 0; i < t; i++) {
            int mas = sc.nextInt();
            int[] array = new int[mas];
            if (mas / 2 % 2 == 1) {
                System.out.println("NO");
            }
            else {
                System.out.println("YES");
                for (int j = 0; mas / 2 > j; j++) {
                    array[j] = (j + 1) * 2;
                    if (j + 1 == mas / 2) {
                        array[j + mas / 2] = (j + 1) * 2 + mas / 2 - 1;
                    }
                    else {
                        array[j + mas / 2] = (j + 1) * 2 - 1;
                    }
                }
                System.out.println(Arrays.toString(array).replace("[","").replace(",", "").replace("]", ""));
            }
        }
    }
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while (t-- > 0){
            int n = sc.nextInt();
            int x = n/2;
            if(x % 2 == 1){
                System.out.println("NO");
                continue;
            }
            System.out.println("YES");
            StringBuilder sb = new StringBuilder();
            int start = 2;
            long sum = 0;
            for(int i = 0; i < x; i++){
                sum += start;
                sb.append(start).append(" ");
                start += 2;
            }
            start = 1;
            long oddSum = 0;
            for(int i = 0; i < x-1; i++){
                oddSum += start;
                sb.append(start).append(" ");
                start += 2;
            }
            sb.append(sum - oddSum);
            System.out.println(sb.toString());
        }
    }
}


import java.util.Scanner;

public class B {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while (t-- > 0){
            int n = sc.nextInt();
            int x = n/2;
            if(x % 2 == 1){
                System.out.println("NO");
                continue;
            }
            System.out.println("YES");
            StringBuilder sb = new StringBuilder();
            int start = 2;
            long sum = 0;
            for(int i = 0; i < x; i++){
                sum += start;
                sb.append(start).append(" ");
                start += 2;
            }
            start = 1;
            int oddSum = 0;
            for(int i = 0; i < x-1; i++){
                oddSum += start;
                sb.append(start).append(" ");
                start += 2;
            }
            sb.append(sum - oddSum);
            System.out.println(sb.toString());
        }
    }
}


import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Scanner;

public class Main {
    private static Data compare(Data d1, Data d2){
        if(d1.length > d2.length)
            return d1;
        if(d2.length > d1.length)
            return d2;
        if(d1.sum > d2.sum)
            return d1;
        if(d2.sum > d1.sum)
            return d2;
        return d1;
    }
    static Data[][] dp;
    private static Data calculate(int[] arr, int current, int previousSign){
        if(current >= arr.length){
            Data d = new Data();
            d.length = Integer.valueOf(0);
            d.sum = Long.valueOf(0);
            return d;
        }

        if(dp[current][previousSign] != null)
            return dp[current][previousSign];

        if(previousSign == 2){
            Data d1 = null;
            if(arr[current] > 0){
                d1 = Data.coyp(calculate(arr, current+1, 1));
                d1.sum += arr[current];
                d1.length++;
            }else{
                d1 = Data.coyp(calculate(arr, current+1, 0));
                d1.sum += arr[current];
                d1.length++;
            }

            Data d2 = Data.coyp(calculate(arr, current+1, previousSign));

            dp[current][previousSign] = compare(d1, d2);
            return dp[current][previousSign];
        }

        if( (arr[current] > 0 && previousSign == 0) || (arr[current] < 0 && previousSign == 1)){
            if(previousSign == 0){
                Data d1 = Data.coyp(calculate(arr, current+1, 1));
                d1.sum += arr[current];
                d1.length++;
                Data d2 = Data.coyp(calculate(arr, current+1, previousSign));
                dp[current][previousSign] = compare(d1, d2);
                return dp[current][previousSign];
            }else{
                Data d1 = Data.coyp(calculate(arr, current+1, 0));
                d1.sum += arr[current];
                d1.length++;
                Data d2 = Data.coyp(calculate(arr, current+1, previousSign));
                dp[current][previousSign] = compare(d1, d2);
                return dp[current][previousSign];
            }
        }else{
            dp[current][previousSign] = Data.coyp(calculate(arr, current+1, previousSign));
            return dp[current][previousSign];
        }
    }

    public static void main(String[] args) throws IOException {
        Reader sc = new Reader();
        int t = sc.nextInt();
        while (t-- > 0){
            int n = sc.nextInt();
            dp = new Data[n][3];
            int[] arr = new int[n];
            for(int i = 0; i < n; i++){
                arr[i] = sc.nextInt();
            }
            Data ans = calculate(arr, 0, 2);
            System.out.println(ans.sum);
        }
    }

    static class Data{
        Integer length;
        Long sum;

        public static Data coyp(Data data){
            Data data1 = new Data();
            data1.length = data.length;
            data1.sum = data.sum;
            return data1;
        }
    }

    /** Faster input **/
    static class Reader {
        final private int BUFFER_SIZE = 1 << 32;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[1024*16];int cnt=0,c;
            while((c=read())!=-1){if(c=='\n')break;buf[cnt++]=(byte)c;}return new String(buf,0,cnt);}
        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();}
    }
}


import java.util.Scanner;
public class Tasks {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        int n;
        int ch;
        int sum1=0;
        int sum2=0;
        for(int i=0;i<t;i++){
            sum1=0;
            sum2=0;
            n = sc.nextInt();
            if(n%4!=0) System.out.print("NO" + "\n");
            else{
                System.out.print("YES" + "\n");
                ch = 2;
                for(int j =0;j<n/2;j++){
                    sum1+=ch;
                    System.out.print(ch+" ");
                    ch+=2;
                }

                ch=1;
                for(int j =0;j<(n/2-1);j++){
                    System.out.print(ch+" ");
                    sum2+=ch;
                    ch+=2;
                }
                System.out.print(sum1-sum2);
                System.out.print("\n");
            }
        }
    }
}


import java.util.Scanner;
public class Tasks {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        int n;
        int ch;
        for(int i=0;i<t;i++){
            n = sc.nextInt();
            if(n%4!=0) System.out.print("NO" + "\n");
            else{
                System.out.print("YES" + "\n");
                ch = 2;
                for(int j =0;j<n/2;j++){
                    System.out.print(ch+" ");
                    ch+=2;
                }
                ch=1;
                for(int j =0;j<n/2;j++){
                    System.out.print(ch+" ");
                    ch+=2;
                }
                System.out.print("\n");
            }
        }
    }
}


import java.util.Scanner;
public class Tasks {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        int n;
        int ch;
        int sum;
        for(int i=0;i<t;i++){
            n = sc.nextInt();
            if(n%4!=0) System.out.print("NO" + "\n");
            else{
                System.out.print("YES" + "\n");
                ch = 2;
                for(int j =0;j<n/2;j++){
                    System.out.print(ch+" ");
                    ch+=2;
                }
                sum=ch;
                ch=1;
                for(int j =0;j<(n/2-1);j++){
                    System.out.print(ch+" ");
                    ch+=2;
                }
                ch-=2;
                System.out.print((2+(sum-2))*n/4-((1+ch)*(n/2-1)/2));
                System.out.print("\n");
            }
        }
    }
}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner newSc = new Scanner(System.in);
        int t = newSc.nextInt();
        for(int i = 0; i < t; i += 1) {
            int n = newSc.nextInt();
            if((n/2) % 2 == 0) {
                System.out.println("YES");
                int j = 0;
                int re = 0;
                for (int l = 0; l < n / 4; l += 1) {
                    System.out.printf("%d %d ", j + 2, j + 4);
                    j += 6;
                }
                j = 0;
                for (int l = 0; l < n / 4; l += 1) {
                    System.out.printf("%d %d ", j + 1, j + 5);
                    j += 6;
                }
                System.out.println("");
            }
            else
                System.out.println("NO");

            }
    }
    }


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner newSc = new Scanner(System.in);
        int t = newSc.nextInt();
        for(int i = 0; i < t; i += 1) {
            int n = newSc.nextInt();
            if(n % 4 == 0) {
                System.out.println("YES");
                int j = 0;
                for (int l = 0; l < n / 4; l += 1, j += 6)
                    System.out.print(j + 2 + " " + j + 4 + " ");
                j = 0;
                for (int l = 0; l < n / 4; l += 1, j += 6)
                    System.out.print(j + 1 + " " + j + 5 + " ");
                System.out.println("");
            }
            else
                System.out.println("NO");
            }
    }
    }


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner newSc = new Scanner(System.in);
        int t = newSc.nextInt();
        for(int i = 0; i < t; i += 1) {
            int n = newSc.nextInt();
            if(n % 4 == 0) {
                System.out.println("YES");
                int j = 0;
                for (int l = 0; l < n / 4; l += 1, j += 6)
                    System.out.printf("%d %d ", j + 2, j + 4);
                j = 0;
                for (int l = 0; l < n / 4; l += 1, j += 6)
                    System.out.printf("%d %d ", j + 1, j + 5);
                System.out.println("");
            }
            else
                System.out.println("NO");
            }
    }
    }


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner newSc = new Scanner(System.in);
        int t = newSc.nextInt();
        for(int i = 0; i < t; i += 1) {
            int n = newSc.nextInt();
            if(n % 4 == 0) {
                System.out.println("YES");
                int j = 0;
                for (int l = 0; l < n / 4; l += 1, j += 6)
                    System.out.print((j + 2) + " " + (j + 4) + " ");
                j = 0;
                for (int l = 0; l < n / 4; l += 1, j += 6)
                    System.out.print((j + 1) + " " + (j + 5) + " ");
                System.out.println("");
            }
            else
                System.out.println("NO");
            }
    }
    }


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner newSc = new Scanner(System.in);
        int t = newSc.nextInt();
        for(int i = 0; i < t; i += 1) {
            int n = newSc.nextInt();
            if(n % 4 == 0) {
                System.out.println("YES");
                int j = 0;
                for (int l = 0; l < n / 4; l += 1, j += 6){
                    System.out.printf("%d ", j + 2);
                System.out.printf("%d ", j + 4);}
                j = 0;
                for (int l = 0; l < n / 4; l += 1, j += 6) {
                    System.out.printf("%d ", j + 1);
                    System.out.printf("%d ", j + 5);
                }
                System.out.println("");
            }
            else
                System.out.println("NO");
            }
    }
    }


import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        int t,n;
        Scanner in=new Scanner(System.in);
        t=in.nextInt();
        for(int i=0;i<t;i++){
            n=in.nextInt();
            if(n%4!=0)System.out.println("NO");
            else{
                System.out.println("YES");
                for(int j=1;j<=n/2;j++){
                    System.out.print(2*j);
                }
                for(int j=1;j<n/2;j++){
                    System.out.print(2*j-1);
                }
                System.out.println(3*n/2-1);
            }
        }
    }
}


import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        int t,n;
        Scanner in=new Scanner(System.in);
        t=in.nextInt();
        for(int i=0;i<t;i++){
            n=in.nextInt();
            if(n%4!=0)System.out.println("NO");
            else{
                System.out.println("YES");
                for(int j=1;j<=n/2;j++){
                    System.out.print(2*j);
                }
                for(int j=1;j<n/2;j++){
                    System.out.print(2*j-1);
                }
                System.out.print(3*n/2-1);
            }
        }
    }
}


import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        int t,n;
        Scanner in=new Scanner(System.in);
        t=in.nextInt();
        for(int i=0;i<t;i++){
            n=in.nextInt();
            if(n%4!=0)System.out.println("NO");
            else{
                System.out.println("YES");
                for(int j=1;j<=n/2;j++){
                    System.out.print(2*j+" ");
                }
                for(int j=1;j<n/2;j++){
                    System.out.print(2*j-1+" ");
                }
                System.out.println(3*n/2-1);
            }
        }
    }
}


import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        int t,n;
        Scanner in=new Scanner(System.in);
        t=in.nextInt();
        for(int i=0;i<t;i++){
            n=in.nextInt();
            if(n%4!=0)System.out.println("NO");
            else{
                System.out.println("YES");
                for(int j=1;j<=n/2;j++){
                    System.out.print(2*j+" ");
                }
                for(int j=1;j<n/2;j++){
                    System.out.print(2*j-1+" ");
                }
                System.out.print(3*n/2-1);
            }
        }
    }
}


import java.util.Scanner;
public class Solution{
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        int t;
        t=in.nextInt();
        int i;
        int[] a =new int[10000];
        for(i=0;i<t;i++)
        	a[i]=in.nextInt();

        for(i=0;i<t;i++) {
        	int num = a[i];
        	int j;
//        	int run=0;
//        	for(j=0;j<200;j++) {
//        	double d = Math.pow(2, j);
//            long ld = (long) d;
//            if((num%ld==0)&&(num/ld==1)&&num!=2) {
////            	System.out.println(ld+"this is ld");
//            	run=1;
//            	break;
//            }

        	int sume=0;
        	int sumo=0;
//        	if(run==1) {
//        		System.out.println();
        		int[] b= new int[200000];
        		int k;
        		for(k=0;k<(num/2);k++) {
        		sume=sume+(2*(k+1));
        		b[k]=(2*(k+1));
//        		System.out.print(b[k]+" ");
        		}
        		int h=0;
        		for(k=(num/2);k<num-1;k++) {
        			int p = b[h]-1;
        			b[k]=p;
        			sumo=sumo+p;
        			h++;
//        			System.out.print(p+" ");
        		}
        		int dif=sume-sumo;
        		if(dif%2==0) {
        			System.out.println();
        			System.out.println("NO");
        		}
        		else {
            		System.out.println("YES");
        			for(j=0;j<num-1;j++) {
        				System.out.print(b[j]+" ");
        			}
        		System.out.print(dif);
        		}

//        	}
//        	if(run!=1) {
//        		System.out.println();
//        		System.out.println("NO");
//        	}

//        }

        }
    }
}


import java.util.Scanner;
public class Solution{
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        int t;
        t=in.nextInt();
        int i;
        int[] a =new int[10000];
        for(i=0;i<t;i++)
        	a[i]=in.nextInt();

        for(i=0;i<t;i++) {
        	int num = a[i];
        	int j;
//        	int run=0;
//        	for(j=0;j<200;j++) {
//        	double d = Math.pow(2, j);
//            long ld = (long) d;
//            if((num%ld==0)&&(num/ld==1)&&num!=2) {
////            	System.out.println(ld+"this is ld");
//            	run=1;
//            	break;
//            }

        	int sume=0;
        	int sumo=0;
//        	if(run==1) {
//        		System.out.println();
        		int[] b= new int[200000];
        		int k;
        		for(k=0;k<(num/2);k++) {
        		sume=sume+(2*(k+1));
        		b[k]=(2*(k+1));
//        		System.out.print(b[k]+" ");
        		}
        		int h=0;
        		for(k=(num/2);k<num-1;k++) {
        			int p = b[h]-1;
        			b[k]=p;
        			sumo=sumo+p;
        			h++;
//        			System.out.print(p+" ");
        		}
        		int dif=sume-sumo;
        		if(dif%2==0) {
        			System.out.println();
        			System.out.println("NO");
        		}
        		else if(dif<num) {
        			System.out.println();
        			System.out.println("NO");

        		}
        		else {
            		System.out.println("YES");
        			for(j=0;j<num-1;j++) {
        				System.out.print(b[j]+" ");
        			}
        		System.out.print(dif);
        		}

//        	}
//        	if(run!=1) {
//        		System.out.println();
//        		System.out.println("NO");
//        	}

//        }

        }
    }
}


import java.util.Scanner;
public class Solution{
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        int t;
        t=in.nextInt();
        int i;
        int[] a =new int[10000];
        for(i=0;i<t;i++)
        	a[i]=in.nextInt();

        for(i=0;i<t;i++) {
        	int num = a[i];
        	int j;
        	int run=0;
        	for(j=0;j<200;j++) {
        	double d = Math.pow(2, j);
            long ld = (long) d;
            if((num%ld==0)&&(num/ld==1)&&num!=2) {
//            	System.out.println(ld+"this is ld");
            	run=1;
            	break;
            }

        	}
        	int sume=0;
        	int sumo=0;
        	if(run==1) {
        		System.out.println("YES");
//        		System.out.println();
        		int[] b= new int[200000];
        		int k;
        		for(k=0;k<(num/2);k++) {
        		sume=sume+(2*(k+1));
        		b[k]=(2*(k+1));
        		System.out.print(b[k]+" ");
        		}
        		int h=0;
        		for(k=(num/2);k<num-1;k++) {
        			int p = b[h]-1;
        			sumo=sumo+p;
        			h++;
        			System.out.print(p+" ");
        		}
        		int dif=sume-sumo;

        		System.out.print(dif);

        	}
        	else {
        		System.out.println();
        		System.out.println("NO");
        	}

        }

    }
}


import java.util.Scanner;
public class Solution{
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        int t;
        t=in.nextInt();
        int i;
        int[] a =new int[10000];
        for(i=0;i<t;i++)
        	a[i]=in.nextInt();

        for(i=0;i<t;i++) {
        	int num = a[i];
        	int j;
//        	int run=0;
//        	for(j=0;j<200;j++) {
//        	double d = Math.pow(2, j);
//            long ld = (long) d;
//            if((num%ld==0)&&(num/ld==1)&&num!=2) {
////            	System.out.println(ld+"this is ld");
//            	run=1;
//            	break;
//            }

        	int sume=0;
        	int sumo=0;
//        	if(run==1) {
//        		System.out.println();
        		int[] b= new int[200000];
        		int k;
        		for(k=0;k<(num/2);k++) {
        		sume=sume+(2*(k+1));
        		b[k]=(2*(k+1));
//        		System.out.print(b[k]+" ");
        		}
        		int h=0;
        		for(k=(num/2);k<num-1;k++) {
        			int p = b[h]-1;
        			b[k]=p;
        			sumo=sumo+p;
        			h++;
//        			System.out.print(p+" ");
        		}
        		int dif=sume-sumo;
        		if(dif%2==0) {
        			System.out.println();
        			System.out.println("NO");
        		}
        		else if(dif<num) {
        			System.out.println();
        			System.out.println("NO");

        		}
        		else {
            		System.out.print("YES");
            		System.out.println();
        			for(j=0;j<num-1;j++) {
        				System.out.print(b[j]+" ");
        			}
        		System.out.print(dif);
        		System.out.println();
        		}

//        	}
//        	if(run!=1) {
//        		System.out.println();
//        		System.out.println("NO");
//        	}

//        }

        }
    }
}


import java.util.Scanner;
public class Solution{
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        int t;
        t=in.nextInt();
        int i;
        int[] a =new int[10000];
        for(i=0;i<t;i++)
        	a[i]=in.nextInt();

        for(i=0;i<t;i++) {
        	int num = a[i];
        	int j;
        	int run=0;
        	for(j=0;j<200;j++) {
        	double d = Math.pow(2, j);
            long ld = (long) d;
            if((num%ld==0)&&(num/ld==1)&&num!=2) {
//            	System.out.println(ld+"this is ld");
            	run=1;
            	break;
            }

        	}
        	int sume=0;
        	int sumo=0;
        	if(run==1) {
        		System.out.println("YES");
//        		System.out.println();
        		int[] b= new int[200000];
        		int k;
        		for(k=0;k<(num/2);k++) {
        		sume=sume+(2*(k+1));
        		b[k]=(2*(k+1));
        		System.out.print(b[k]+" ");
        		}
        		int h=0;
        		for(k=(num/2);k<num-1;k++) {
        			int p = b[h]-1;
        			sumo=sumo+p;
        			h++;
        			System.out.print(p+" ");
        		}
        		int dif=sume-sumo;
        		System.out.print(dif+b[h-1]-2);

        	}
        	else {
        		System.out.println();
        		System.out.println("NO");
        	}

        }

    }
}


import java.util.*;
import java.io.*;
import java.util.function.*;
// import lib.util.*;
// import lib.graph.*;
// import lib.io.*;
// import lib.math.*;

public class Main {

    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
        int t = sc.nextInt();
        for (int sample = 0; sample < t; t++) {
            int n = sc.nextInt();
            int[] odd = new int[n / 2];
            int[] even = new int[n / 2];
            if (n % 4 != 0) {
                System.out.println("NO");
                continue;
            }
            System.out.println("YES");
            int sign = -1;
            for (int i = 0; i < n / 2; i++) {
                odd[i] = 2 * i + 1;
                even[i] = odd[i] + sign;
                sign *= -1;
            }
            for (int i = 0; i < n / 2; i++) {
                System.out.print(even[i] + " ");
            }
            for (int i = 0; i < n / 2; i++) {
                System.out.print(odd[i] + " ");
            }
            System.out.println();

            out.flush();
        }
    }

}

class UnionFindTree {
    int[] root;
    int[] rank;
    int[] size;
    int m;

    public UnionFindTree(int n) {
        this.root = new int[n];
        this.rank = new int[n];
        this.size = new int[n];
        this.m = n;
        for (int i = 0; i < n; i++) {
            root[i] = i;
            size[i] = 1;
        }
    }

    public int find(int x) {
        if (root[x] == x)
            return x;
        else {
            return root[x] = find(root[x]);
        }
    }

    public void unite(int x, int y) {
        x = find(x);
        y = find(y);
        if (x == y)
            return;
        if (rank[x] < rank[y]) {
            size[find(y)] = size[find(x)];
            root[x] = y;
        } else {
            size[find(x)] = size[find(y)];
            root[y] = x;
            if (rank[x] == rank[y])
                rank[x]++;
        }
        m--;
    }

    public boolean same(int x, int y) {
        return find(x) == find(y);
    }

    public int size(int i) {
        return this.size[find(i)];
    }
}

class Dijkstra {
    private static int prev[];
    private static long dist[];

    public Dijkstra(AbstractGraph graph, int s) {
        prev = new int[graph.n];
        dist = new long[graph.n];
        Arrays.fill(prev, -1);
        Arrays.fill(dist, Long.MAX_VALUE);
        PriorityQueue<Integer> searching = new PriorityQueue<>((x, y) -> Long.compare(dist[x], dist[y]));
        dist[s] = 0;
        searching.add(s);
        while (searching.size() > 0) {
            int now = searching.poll();
            for (Edge e : graph.getEdges(now)) {
                int next = e.to;
                long c = e.cost;
                if (dist[now] + c < dist[next]) {
                    dist[next] = dist[now] + c;
                    prev[next] = now;
                    searching.add(next);
                }
            }
        }
    }

    public int[] path(int to) {
        ArrayList<Integer> rev = new ArrayList<>();
        for (int now = to; now != -1; now = this.prev[now]) {
            rev.add(now);
        }
        int[] path = new int[rev.size()];
        for (int i = 0; i < path.length; i++) {
            path[i] = rev.get(path.length - i - 1);
        }
        return path;
    }
}

class WF {
    private static long[][] dist;

    public WF(AbstractGraph graph) {
        dist = new long[graph.n][graph.n];
        for (int i = 0; i < dist.length; i++) {
            Arrays.fill(dist[i], Integer.MAX_VALUE);
        }
        for (int i = 0; i < graph.n; i++) {
            for (Edge e : graph.getEdges(i)) {
                dist[i][e.to] = e.cost;
            }
            dist[i][i] = 0;
        }
        for (int k = 0; k < graph.n; k++) {
            for (int i = 0; i < graph.n; i++) {
                for (int j = 0; j < graph.n; j++) {
                    if (dist[i][k] != Integer.MAX_VALUE && dist[k][j] != Integer.MAX_VALUE) {
                        dist[i][j] = Math.min(dist[i][j], dist[i][k] + dist[k][j]);
                    }
                }
            }
        }
    }

    public static long getShortest(int s, int t) {
        return dist[s][t];
    }

    public static long[][] getAllDist() {
        return dist;
    }

    public static boolean isNegativeLoop() {
        for (int i = 0; i < dist.length; i++) {
            if (dist[i][i] < 0) {
                return true;
            }
        }
        return false;
    }
}

class Edge {
    int from, to;
    long cost;

    public Edge(int from, int to, long cost) {
        this.from = from;
        this.to = to;
        this.cost = cost;
    }

    public Edge(int from, int to) {
        this.from = from;
        this.to = to;
        this.cost = 1;
    }

    public Edge reverse() {
        return new Edge(to, from, cost);
    }
}

@SuppressWarnings("unchecked")
abstract class AbstractGraph {
    int n;
    int m;
    ArrayList<Edge>[] edges;

    public AbstractGraph(int n) {
        this.n = n;
        this.m = 0;
        this.edges = new ArrayList[n];
        for (int i = 0; i < n; i++) {
            this.edges[i] = new ArrayList<Edge>();
        }
    }

    public void addEdge(Edge e) {
        this.m++;
        this.edges[e.from].add(e);
    }

    public int getV() {
        return this.n;
    }

    public int getE() {
        return this.m;
    }

    public ArrayList<Edge> getEdges(int v) {
        return this.edges[v];
    }

    abstract public boolean isBipartite();

    public boolean isTree() {
        // require Modifying.
        return false;
    }
}

class Graph extends AbstractGraph {
    int n;
    int m;
    // array of edges which is connect to the node
    ArrayList<Edge>[] edges;

    public Graph(int n) {
        super(n);
    }

    public void addEdge(int from, int to, int cost) {
        Edge e = new Edge(from, to, cost);
        super.addEdge(e);
        super.addEdge(e.reverse());
        this.m++;
    }

    @Override
    public void addEdge(Edge e) {
        this.edges[e.from].add(e);
        this.edges[e.to].add(e.reverse());
        this.m++;
    }

    public int getV(int v) {
        return n;
    }

    public int getE() {
        return m;
    }

    public boolean isBipartite() {
        int[] color = new int[n];
        PriorityQueue<Integer> queue = new PriorityQueue<>();
        HashSet<Integer> visited = new HashSet<>();
        queue.add(0);
        color[0] = 1;
        while (queue.size() > 0) {
            int now = queue.poll();
            visited.add(now);
            for (Edge e : getEdges(now)) {
                if (visited.contains(e.to)) {
                    continue;
                }
                if (color[e.to] == color[now])
                    return false;
                queue.add(e.to);
                if (color[e.to] == 0)
                    color[e.to] = -1 * color[now];
            }
        }
        return true;
    }
}

class DirectedGraph extends AbstractGraph {
    int n;
    int m;
    // array of edges which is connect to the node
    ArrayList<Edge>[] edges;

    public DirectedGraph(int n) {
        super(n);
    }

    public void addEdge(int from, int to, int cost) {
        Edge e = new Edge(from, to, cost);
        super.addEdge(e);
        this.m++;
    }

    @Override
    public void addEdge(Edge e) {
        this.edges[e.from].add(e);
        this.m++;
    }

    public int getV(int v) {
        return this.n;
    }

    public int getE() {
        return this.m;
    }

    public boolean isBipartite() {
        // need to rewrite to work
        return false;
    }

}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() {
        if (hasNextByte())
            return buffer[ptr++];
        else
            return -1;
    }

    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
        return hasNextByte();
    }

    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext())
            throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }

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

class MyMath {
    public static long gcm(long a, long b) {

        // if (a < b)
        // return gcm(b, a);

        // if (b == 0 || a % b == 0)
        // return b;

        // return gcm(b, a % b);
        if (a < b) {
            long tmp = a;
            a = b;
            b = tmp;
        }
        long r = -1;
        while (r != 0) {
            r = a % b;
            a = b;
            b = r;
        }
        return a;
    }

    public static long summation(long a, long b) {
        return b * (b + 1) / 2 - a * (a - 1) / 2;
    }

    public static long factorial(long n) {

        if (n <= 1)
            return 1;
        else
            return factorial(n - 1) * n;
    }

    public static long[][] binomialTable(int a, long m) {
        long[][] table = new long[a + 1][a + 1];
        for (int i = 0; i < a + 1; i++) {
            table[0][a] = 0;
            table[i][0] = 1;
            table[i][i] = 1;
        }
        for (int i = 1; i < a + 1; i++) {
            for (int j = 1; j < a + 1; j++) {
                if (i < j)
                    table[i][j] = 0;
                else {
                    table[i][j] = (table[i - 1][j - 1] + table[i - 1][j]) % m;
                }
            }
        }
        return table;
    }

    public static long binomial(int n, int k, long m) {
        long res = 1;
        for (int l = n - k + 1; l <= n; l++) {
            res = (res % m) * (l % m) % m;
        }
        for (int r = 1; r <= k; r++) {
            res = (res % m) * modinv(r, m) % m;
        }
        return res;
    }

    public static long repeatSquarePow(long a, long n, long p) {
        if (n == 0)
            return 1;
        if (n == 1)
            return a % p;
        if (n % 2 == 1)
            return a * repeatSquarePow(a, n - 1, p) % p;
        long tmp = repeatSquarePow(a, n / 2, p) % p;
        return tmp * tmp % p;
    }

    public static long modinv(long a, long p) {
        long b, x, u, q, abs_p, tmp;
        abs_p = Math.abs(p);
        b = p;
        x = 1;
        u = 0;
        while (b > 0) {
            q = a / b;
            tmp = u;
            u = x - q * u;
            x = tmp;
            tmp = b;
            b = a - q * b;
            a = tmp;
        }
        return (x < 0) ? abs_p + x : x;
    }

    public static Long[] eratosthenes(int n) {
        Long[] factor_table = new Long[n];
        for (long i = 1; i <= n; i++) {
            factor_table[(int) (i - 1)] = i;
        }
        for (long i = 1; i <= n; i++) {
            if (factor_table[(int) (i - 1)] == i) {
                int j = 2;
                while (i * j <= n) {
                    factor_table[(int) (i * j - 1)] = i;
                    j++;
                }
            }
        }

        return factor_table;
    }

    public static HashMap<Long, Integer> primeFactorization(long n) {
        HashMap<Long, Integer> primes = new HashMap<>();
        for (long p = 2; p * p <= n; p++) {
            int q = 0;
            while (n % p == 0) {
                n /= p;
                q++;
            }
            if (q > 0)
                primes.put(p, q);
        }
        if (n > 1)
            primes.put(n, 1);
        return primes;
    }

    public static ArrayList<Integer> divisor(int n) {
        ArrayList<Integer> ret = new ArrayList<Integer>();
        for (int i = 1; i * i <= n; i++) {
            if (n % i == 0) {
                ret.add(i);
                // n=PQ+0→ PもQも約数. ただし、Q=Pは↑で登録済みなので登録しない
                if (i != n / i)
                    ret.add(n / i);
            }
        }
        return ret;
    }
}

class nextPermutation {
    public static int[] swap(int data[], int left, int right) {

        // Swap the data
        int temp = data[left];
        data[left] = data[right];
        data[right] = temp;

        // Return the updated array
        return data;
    }

    // Function to reverse the sub-array
    // starting from left to the right
    // both inclusive
    public static int[] reverse(int data[], int left, int right) {

        // Reverse the sub-array
        while (left < right) {
            int temp = data[left];
            data[left++] = data[right];
            data[right--] = temp;
        }

        // Return the updated array
        return data;
    }

    // Function to find the next permutation
    // of the given integer array
    public static boolean findNextPermutation(int data[]) {

        // If the given dataset is empty
        // or contains only one element
        // next_permutation is not possible
        if (data.length <= 1)
            return false;

        int last = data.length - 2;

        // find the longest non-increasing suffix
        // and find the pivot
        while (last >= 0) {
            if (data[last] < data[last + 1]) {
                break;
            }
            last--;
        }

        // If there is no increasing pair
        // there is no higher order permutation
        if (last < 0)
            return false;

        int nextGreater = data.length - 1;

        // Find the rightmost successor to the pivot
        for (int i = data.length - 1; i > last; i--) {
            if (data[i] > data[last]) {
                nextGreater = i;
                break;
            }
        }

        // Swap the successor and the pivot
        data = swap(data, nextGreater, last);

        // Reverse the suffix
        data = reverse(data, last + 1, data.length - 1);

        // Return true as the next_permutation is done
        return true;
    }
}

class ArrayUtil {
    private static long INF = 1_000_000_000_0L;

    public static int UpperBound(long[] array, long obj) {
        int l = 0, r = array.length - 1;
        while (r - l >= 0) {
            int c = (l + r) / 2;
            if (obj < array[c]) {
                r = c - 1;
            } else {
                l = c + 1;
            }
        }
        return l;
    }

    public static int LowerBound(long[] array, long obj) {
        int l = 0, r = array.length - 1;
        while (r - l >= 0) {
            int c = (l + r) / 2;
            if (obj <= array[c]) {
                r = c - 1;
            } else {
                l = c + 1;
            }
        }
        return l;
    }

    // return the length of array's LIS
    public static int LIS(long[] array) {
        long[] dp = new long[array.length + 1];
        Arrays.fill(dp, INF);
        for (int i = 0; i < array.length; i++) {
            int idx = LowerBound(dp, array[i]);
            dp[idx] = array[i];
        }
        return LowerBound(dp, INF - 1);
    }

    public static int StrictLIS(long[] array) {
        long[] dp = new long[array.length + 1];
        Arrays.fill(dp, INF);
        for (int i = 0; i < array.length; i++) {
            int idx = UpperBound(dp, array[i]);
            dp[idx] = array[i];
        }
        return UpperBound(dp, INF - 1);
    }
}

class BinaryIndexedTree {
    int[] data;
    long[] tree;
    int n;

    public BinaryIndexedTree(int[] data) {
        this.data = data;
        this.n = data.length;
        this.tree = new long[n + 1];
        buildTree();
    }

    public void buildTree() {
        for (int i = 0; i < n; i++) {
            add(i + 1, data[i]);
        }
    }

    public void add(int index, int value) {
        for (int i = index; i <= n; i += i & -i) {
            tree[i] += value;
        }
    }

    public long sum(int from, int to) {
        return sum(to) - sum(from - 1);
    }

    public long sum(int index) {
        int sum = 0;
        for (int i = index; i > 0; i -= i & -i) {
            sum += tree[i];
        }
        return sum;
    }
}