#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    if ((n % 2 == 1) || (n / 2) % 2 == 1 || n < 2)
      cout << "NO"
           << "\n";
    else {
      int arr[n];
      for (int i = 0; i < n / 2; i++) {
        arr[i] = (i + 1) * 2;
        arr[i + (n / 2)] = arr[i] - 1;
      }
      arr[n - 1] = arr[n - 1] + (n / 4) * 2;
      cout << "YES"
           << "\n";
      for (auto x : arr) cout << x << " ";
      cout << "\n";
    }
  }
  return EXIT_SUCCESS;
}
