PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000348. Phân hoạch dãy và xóa ít phần tử nhất (Baby Ehab Partitions Again)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Phân hoạch dãy và xóa ít phần tử nhất (Baby Ehab Partitions Again)

Baby Ehab Partitions Again

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

An array of NN positive integers is good if its elements cannot be partitioned into two disjoint groups of equal sum. Each original element must belong to exactly one group; groups need not be contiguous.

Remove the minimum number of elements so that the remaining array is good. Output that minimum count and the original one-based indices of removed elements.

Any optimal choice is accepted; the problem guarantees a valid answer.

Input

Line 1: NN.

Line 2: NN positive integers A1,…,ANA_1,\ldots,A_N.

Output

Line 1: the minimum number tt of removed elements.

If t>0t>0, line 2 contains tt distinct indices in [1,N][1,N]. If t=0t=0, print just 0. A custom checker accepts all valid optimal solutions.

Subtasks

  • Subtask 1 (20 points): 2≤N≤122\le N\le12, 1≤Ai≤1001\le A_i\le100.
  • Subtask 2 (30 points): 2≤N≤402\le N\le40, 1≤Ai≤10001\le A_i\le1000.
  • Subtask 3 (50 points): 2≤N≤1002\le N\le100, 1≤Ai≤20001\le A_i\le2000.

Examples

Example 1

Input

4
6 3 9 12

Output

1
2

Explanation

The original array can be split into groups summing to 15. Deleting index 2 leaves sum 27, which is odd, so equal partition is impossible.

Example 2

Input

2
1 2

Output

0

Explanation

The original sum is 3, so equal partition is already impossible. Remove no elements.