#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    if (n == 2) {
      cout << "NO"
           << "\n";
    } else {
      int j = 2;
      int ans1 = 0;
      for (int i = 0; i < (n / 2); i++) {
        ans1 += j;
        j += 2;
      }
      j = 1;
      int ans2 = 0;
      for (int i = 0; i < (n / 2) - 1; i++) {
        ans2 += j;
        j += 2;
      }
      if ((ans1 - ans2) % 2 == 0) {
        cout << "NO"
             << "\n";
      } else {
        cout << "YES"
             << "\n";
        int j = 2;
        int ans1 = 0;
        for (int i = 0; i < (n / 2); i++) {
          cout << j << " ";
          ans1 += j;
          j += 2;
        }
        j = 1;
        int ans2 = 0;
        for (int i = 0; i < (n / 2) - 1; i++) {
          cout << j << " ";
          ans2 += j;
          j += 2;
        }
        cout << (ans1 - ans2) << "\n";
      }
    }
  }
  return 0;
}
