Logo
(追記) (追記ここまで)

24067번 - KPart 서브태스크다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB89181147.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ドル ≤ T ≤ 20$.
  • Let $\sum{A}$ represent the sum of the values in any one array (not the sum of the values in all of the arrays). Then 1ドル ≤ \sum{A} ≤ 100,000円$.

서브태스크

번호배점제한
110

1ドル ≤ N ≤ 30$

220

31ドル ≤ N ≤ 120$

370

121ドル ≤ N ≤ 1,000円$

예제 입력 1

2
7
7 3 5 1 3 3 5
6
1 2 3 5 8 3

예제 출력 1

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.

출처

Olympiad > European Junior Olympiad in Informatics > eJOI 2021 2번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /