#include <bits/stdc++.h>
using ll = long long;
using ld = long double;
using ull = unsigned long long;
const ll mod = 1e17 + 7;
using namespace std;
const int N = 1e6 + 5;
ll tong, m, n, k, t, T, ntest, ans, u, v, b[N], a[N];
string s;
vector<ll> kq, res;
vector<ll> adj[N], adt[N];
bool check;
ll f(ll u) {
  for (int i = 1; i <= n; i++) tong += a[i];
  return tong;
}
void dfs(ll u) {
  if (check) return;
  a[u] = 1;
  kq.push_back(u);
  for (ll v : adj[u]) {
    if (a[v] == 1) {
      k = v;
      check = true;
      return;
    }
    if (a[v] == 0) dfs(v);
  }
  a[u] = 2;
}
inline void sol() {
  cin >> n;
  kq.clear();
  res.clear();
  for (int i = 1; i <= n; i++) adj[i].clear();
  for (int i = 1; i <= n; i++) {
    a[i] = 0;
    cin >> m;
    adj[i].push_back(i - m);
  }
  check = false;
  for (int i = 1; i <= n; i++) {
    if (check) break;
    kq.clear();
    if (a[i] != 2) dfs(i);
  }
  for (int i = kq.size() - 1; i >= 0; i--) {
    res.push_back(kq[i]);
    if (kq[i] == k) break;
  }
  sort(res.begin(), res.end());
  cout << res.size() << '\n';
  for (ll u : res) cout << u << " ";
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> ntest;
  while (ntest-- > 0) sol();
}
