logo AlgoBeat OnlineJudge
登录 注册

#214333. [ICPC 2025 Xi'an Practice] Great Indices

内存限制:512 MiB 时间限制:2000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

You are given a sequence . For each , index is called if and only if the following holds:

  • There is at most one index such that is not a divisor of .

Your task is to find all indices in the sequence.

Recall that an integer is a divisor of an integer if and only if there exists an integer such that .

输入格式

The input consists of multiple test cases. The first line contains an integer (), the number of test cases. For each test case:

  • The first line contains a single integer (), representing the length of sequence .
  • The second line contains integers (), representing the given sequence.

It is guaranteed that the sum of over all test cases does not exceed .

输出格式

For each test case, output two lines:

  • The first line contains a single integer , representing the number of indices.
  • The second line contains integers (), representing the indices .

样例

样例输入 1

3
4
1 2 3 6
6
1 1 4 5 1 4
5
1 9 1 9 810

样例输出 1

1
4 
2
3 6 
3
2 4 5 

数据范围与提示

In the first test case:

  • When , the indices where is not a divisor of are , , and . Since , index is not a index.
  • When , there are two indices, and , for which is not a divisor of .
  • When , there are two indices, and , for which is not a divisor of .
  • When , each of is a divisor of , so that index is a index.

Therefore, the only index is .