#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int tests; cin >> tests; while (tests--) { int n; cin >> n; vector next(n), indegree(n, 0); for (int i = 0; i < n; ++i) { int value; cin >> value; next[i] = i - value; ++indegree[next[i]]; } queue leaves; for (int i = 0; i < n; ++i) if (indegree[i] == 0) leaves.push(i); while (!leaves.empty()) { int v = leaves.front(); leaves.pop(); if (--indegree[next[v]] == 0) leaves.push(next[v]); } int start = 0; while (indegree[start] == 0) ++start; vector cycle; int v = start; do { cycle.push_back(v); v = next[v]; } while (v != start); cout << cycle.size() << '\n'; for (int x : cycle) cout << x + 1 << ' '; cout << '\n'; } return 0; }