#include <bits/stdc++.h>
using namespace std;
const int N = 2040;
int n, t, a[N];
vector<int> v;
void op(int x) {
  v.push_back(x);
  for (int i = 1; i < x / 2 + 1; i++) swap(a[i], a[x - i + 1]);
}
int main() {
  cin >> t;
  while (t--) {
    int mv = 0;
    cin >> n;
    for (int i = 1; i < n + 1; i++) {
      cin >> a[i];
      if ((i & 1) != (a[i] & 1)) {
        mv = 1;
      }
    }
    if (mv == 0) {
      for (int i = n; i > 1; i -= 2) {
        for (int j = 1; j < n + 1; j++) {
          if (a[j] == i) {
            op(j);
            break;
          }
        }
        for (int j = 2; j < n + 1; j++) {
          if (a[j] == i - 1) {
            op(j - 1);
            op(j + 1);
            op(3);
            op(i);
            break;
          }
        }
      }
      cout << v.size() << endl;
      for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
      cout << endl;
      v.clear();
    } else
      cout << -1 << endl;
  }
}
