#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, val;
  cin >> t;
  while (t--) {
    cin >> n;
    int even = 2;
    int odd = 1;
    int r = n / 2;
    int odd_sum = 0;
    int even_sum = 0;
    if (n % 4 == 0) {
      cout << "YES" << endl;
      for (int i = 1; i <= r; i++) {
        cout << even << " ";
        even_sum += even;
        even += 2;
      }
      for (int i = 1; i <= r - 1; i++) {
        cout << odd << " ";
        odd_sum += odd;
        odd += 2;
      }
      int last = even_sum - odd_sum;
      cout << last << endl;
    } else
      cout << "NO" << endl;
  }
  return 0;
}
