#include <bits/stdc++.h>
using namespace std;
int T, n, m;
vector<int> ans;
int vis[2000050], flag;
int dfn[2000050], pre[2000050], idx;
int head[2000050], ver[2000050 << 2], nxt[2000050 << 2], fan[2000050 << 2], tot;
inline int qr() {
  char a = 0;
  int w = 1, x = 0;
  while (a < '0' || a > '9') {
    if (a == '-') w = -1;
    a = getchar();
  }
  while (a >= '0' && a <= '9') {
    x = (x << 3) + (x << 1) + (a ^ 48);
    a = getchar();
  }
  return x * w;
}
int main() {
  T = qr();
  while (T--) {
    n = qr();
    flag = 0;
    ans.clear();
    memset(vis, 0, (n + 1) << 2);
    for (register int i = 1; i <= n; i++) {
      int x = qr();
      ver[i] = i - x;
      if (i - x == i && !flag) {
        flag = 1;
        printf("1 %d\n", i);
      }
    }
    if (flag) continue;
    int pos = 1;
    while (!vis[pos]) {
      vis[pos] = 1, pos = ver[pos];
    }
    ans.push_back(pos);
    pos = ver[pos];
    while (pos != ans[0]) {
      ans.push_back(pos), pos = ver[pos];
    }
    printf("%d\n", (int)ans.size());
    for (register int i = 0, siz = ans.size(); i < siz; i++)
      printf("%d ", ans[i]);
    printf("\n");
  }
  return 0;
}
