#include <bits/stdc++.h>
using namespace std;
long long ans = 1ll;
long long MOD = 1000000007;
std::vector<long long> g[51];
bool visited[51];
void dfs(long long i) {
  visited[i] = true;
  for (long long child : g[i]) {
    if (!visited[child]) {
      ans *= 2;
      dfs(child);
    }
  }
}
long long fact(long long k) {
  if (k == 1) return 1;
  return k * fact(k - 1);
}
bool isSubSequence(string tobechecked, string str2, int m, int n) {
  if (m == 0) return true;
  if (n == 0) return false;
  if (tobechecked[m - 1] == str2[n - 1])
    return isSubSequence(tobechecked, str2, m - 1, n - 1);
  return isSubSequence(tobechecked, str2, m, n - 1);
}
int main() {
  long long t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int k = n / 2;
    if (k % 2 == 1)
      cout << "NO" << endl;
    else {
      std::vector<int> odd;
      std::vector<int> even;
      int z = k / 2;
      for (int i = 1; i <= z; i++) {
        even.push_back((i - 1) * 6 + 2);
        even.push_back((i - 1) * 6 + 4);
        odd.push_back((i - 1) * 6 + 1);
        odd.push_back((i - 1) * 6 + 5);
      }
      cout << "YES" << endl;
      for (int x : even) cout << x << " ";
      for (int x : odd) cout << x << " ";
      cout << endl;
    }
  }
  return 0;
}
