#include <bits/stdc++.h>
using namespace std;
long long int mx = INT_MAX;
long long int mn = INT_MIN;
long long int mod = 1e9 + 7;
const long long int maxs = 1e5 + 5;
long long int max2d = 1e3 + 3;
long long int INF = 9e18;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int T;
  cin >> T;
  while (T--) {
    long long int N;
    cin >> N;
    if ((N / 2) % 2) {
      cout << "NO"
           << "\n";
      continue;
    }
    cout << "YES"
         << "\n";
    long long int a[N + 1];
    long long int num = 2, sum = 0;
    for (long long int i = 1; i <= N / 2; i++) {
      a[i] = num;
      sum += num;
      num += 2;
    }
    num = 1;
    for (long long int i = N / 2 + 1; i <= N; i++) {
      if (i == N)
        a[i] = sum;
      else {
        a[i] = num;
        sum -= num;
        num += 2;
      }
    }
    for (long long int i = 1; i <= N; i++) cout << a[i] << " ";
    cout << "\n";
  }
  return 0;
}
