#include <bits/stdc++.h>
using namespace std;
int T;
int main() {
  scanf("%d", &T);
  while (T--) {
    int n;
    int res = 0;
    int res1 = 0;
    scanf("%d", &n);
    if (n % 4 == 0) {
      puts("YES");
      for (int i = 1, j = 2; i <= n / 2; ++i, j += 2) {
        res += j;
        printf("%d ", j);
      }
      for (int i = 1, j = 1; i <= n / 2 - 1; ++i, j += 2) {
        res1 += j;
        printf("%d ", j);
      }
      printf("%d\n", res - res1);
    } else
      puts("NO");
  }
  return 0;
}
