Code Peacefully, I refuse !!!
- Jack
Beast pirates has a unique hierarchy of power, which their General Kaido thinks is the best to attain One Piece. Kaido classified his men in terms of the power, highest rated pirates in his crew are called All-Stars. They form a stronger combination of power that, no one can rival their power (of course except their General Kaido).
If there are n members of All-Star squad, then the power of the members All stars are represented by an integer xi . The All-Star squad has such a unique mathematical property that, there exists a member in All-Star that the sum of the powers of the other members equals that member. This property makes the group deadly, this is the secret to acquire One Piece Treasure.
Now here is the problem, Kaido wants to create a valid team of All-Stars. He has n valid people which are powerful as valid All-Star, but he wants that there would be n-1 people who are All-Stars, so out of n people, we need n-1 people, who satisfy the All-Star property. He needs the list of all the indices of the people, when removed, produce a valid All-Star Squad.
Example, initially Kaido had [8, 3, 5, 2], now if he remove the index 1, he is left with [3, 5, 2] and 5 == 2+3, and also if he could also have removed person with index 4, so he would be left with [8, 3, 5] and 8 == 3+5.
Input
First line would contain n the number of people Kaido initially had, and next line contains the n space separated integers, pi which state the power of each person.
Output
First line of output will contain just an integer x, which state there can be x indices where the people can be removed, next line contains x space separated integers(sorted with respect to the index) which tells the the index (1-based) of each person which when removed would create a All-Star list of n-1 people.
Constraints
n <= 105
1 <= xi <= 109
On Removing 2 from the input list, we will have {5, 2, 2, 1} so 5 == 2+2+1, now there are 3 2's so 2 on index 1, 4, 5 when removed makes All Star Squad of size 4.