#include <bits/stdc++.h>
using namespace std;
vector<int> e[1000001];
int len[1000001];
int s[1000001];
int t;
int p = 0;
int pa[1000001];
int head, tail;
int ans[1000001];
int DFS(int root) {
  for (int i = 0; i < e[root].size(); i++) {
    if (!pa[e[root][i]]) {
      pa[e[root][i]] = root;
      if (DFS(e[root][i])) {
        return true;
      }
    } else {
      head = e[root][i];
      tail = root;
      return true;
    }
  }
  return false;
}
int main() {
  cin >> t;
  for (int i = 1; i <= t; i++) {
    scanf("%d", &len[i]);
    for (int j = 1; j <= len[i]; j++) {
      scanf("%d", &s[p]);
      p++;
    }
  }
  p = 0;
  for (int i = 1; i <= t; i++) {
    for (int j = 1; j <= len[i]; j++) {
      e[j].clear();
      pa[j] = 0;
    }
    for (int j = 1; j <= len[i]; j++) {
      e[j].push_back(j - s[p]);
      p++;
    }
    pa[1] = 1;
    DFS(1);
    ans[0] = 0;
    while (tail != head) {
      ans[0]++;
      ans[ans[0]] = tail;
      tail = pa[tail];
    }
    ans[0]++;
    ans[ans[0]] = tail;
    printf("%d\n", ans[0]);
    for (int i = 1; i <= ans[0]; i++) {
      printf("%d ", ans[i]);
    }
    printf("\n");
  }
  return 0;
}
