#include <bits/stdc++.h>
int main() {
  long int t, n, i, j, a, b;
  scanf("%ld", &t);
  for (i = 1; i <= t; i++) {
    a = 0;
    b = 0;
    scanf("%ld", &n);
    if ((n / 2) % 2 != 0)
      printf("NO\n");
    else {
      printf("YES\n");
      for (j = 1; j <= n / 2; j = j + 1) {
        printf("%ld ", j * 2);
        a = a + j * 2;
      }
      for (j = 1; j < n / 2; j = j + 1) {
        printf("%ld ", j * 2 - 1);
        b = b + j * 2 - 1;
      }
      printf("%ld\n", a - b);
    }
  }
}
