#include "bits/stdc++.h"
using namespace std;
 
#define nl '\n'
#define ll long long 
#define ull unsigned long long
#define debug(x)       { cerr << #x << " = " << x << endl; } 
#define fastread ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 
 
const int Max = (int)2e5+5;
 
//functions
ll lcm(ll a,ll b) {if(a==0 || b==0){return 0;}else{return (a*b)/__gcd(a,b);}}
 
//direction arry
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};
int dx4[] = {0, 0, 1, -1};
int dy4[] = {1, -1, 0, 0};
 
//____________________________________________________________________________________________________
int arr[Max];
void solve()
{
    ll n;cin>>n;
    if(n/2 & 1)
        cout<<"NO"<<endl;
    else
    {
        cout<<"YES"<<endl;
        ll sum =0;
        for(int i=1;i<=n/2;i++)
        {
            if(i==1)
                arr[i]=2;
            arr[i]=arr[i-1]+2;
            sum+=arr[i];
        }
        ll sum1=0;
        for(int i=n/2+1;i<=n;i++)
        {
            if(i==n/2+1)
                arr[i]=1;
            else if(i==n)
            {
                arr[i]=sum-sum1;
            }
            else
            {
                arr[i]=arr[i-1]+2;
            }
            sum1+=arr[i];
        }
        for(int i=1;i<=n;i++)
        {
            cout<<arr[i]<<" ";
        }
        cout<<endl;
    }
}
int main()
{
    fastread;
    int tc=1;
    cin>>tc;
    while(tc--){
        solve();
    }
    return 0;
}