#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
using ll = long long;
#define int long long
#define db double
#define all(a) a.begin(), a.end()
const int M = 5e3 + 7;
const int mod = 100003;
const double pi = acos(-1.0);
int n, m, k, h;
void solve()
{
cin >> n;
if (n == 2)
{
cout << "NO" << endl;
return;
}
int a = n / 2;
if (a % 2 == 1)
{
cout << "NO" << endl;
return;
}
cout << "YES" << endl;
h = 0;
for (int i = 1; i <= n / 2; i++)
{
cout << 2 * i << ' ';
h += 2 * i;
}
k = 0, m = 0;
for (int i = 1;; i += 2)
{
if (k == n / 2 - 1)
{
cout << h - m << endl;
break;
}
cout << i << ' ';
k++, m += i;
}
}
signed main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int qwq = 1;
cin >> qwq;
while (qwq--)
{
solve();
}
return 0;
}