| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 1024 MB | 89 | 18 | 11 | 47.826% |
Virgil has just set out to study the properties of arrays. Thus, he defines a $K$-array as any array $A$ of positive integers such that all length $K$ continuous subsequences of $A$ can be partitioned into two disjoint, potentially not continuous subsequences having equal sum. For example 1ドル,ドル 2ドル,ドル 1ドル,ドル 3ドル$ is a 3ドル$-array, since 1ドル,ドル 2ドル,ドル 1ドル$ can be partitioned into 1ドル,ドル 1ドル$ and 2ドル$ which both have sum 2ドル,ドル and 2ドル,ドル 1ドル,ドル 3ドル$ can be partitioned into 2ドル,ドル 1ドル$ and 3ドル$ which both have sum 3ドル$. It is not a 2ドル$-array, since 1ドル,ドル 2ドル$ cannot be partitioned into two potentially not continuous subsequences with equal sum. Likewise it is not a 4ドル$-array.
You are given $T$ arrays of positive integers. For each array $A$ Virgil wants to know all the values of $K$ for which $A$ is a $K$-array.
The first line contains the integer $T$. The $T$ arrays follow. Each array is represented by two lines. The first line contains $N,ドル the length of the array. The second contains the elements of the array, separated by a single space.
Output the answers for each array $A$ in order. For each array output only one line containing first the number of values of $K$ for which the given array is a $K$-array, and then those values of $K$ for which the array is a $K$-array, in increasing order.
| 번호 | 배점 | 제한 |
|---|---|---|
| 1 | 10 | 1ドル ≤ N ≤ 30$ |
| 2 | 20 | 31ドル ≤ N ≤ 120$ |
| 3 | 70 | 121ドル ≤ N ≤ 1,000円$ |
2 7 7 3 5 1 3 3 5 6 1 2 3 5 8 3
2 4 6 2 3 6
The first array, the one of length 7ドル,ドル is a 4ドル$-array and 6ドル$-array, since each continuous subsequence of length 4ドル$ and 6ドル,ドル respectively, can be partitioned into two potentially not continuous subsequences with equal sum.
The second array, the one of length 6ドル,ドル is 3ドル$-array and 6ドル$-array, since each continuous subsequence of length 3ドル$ and the of length 6ドル$ can be partitioned into two potentially not continuous subsequences with equal sum.