arbitrary choices that are made during the title are made similarly plausible and autonomously. For instance, assuming n=4, a=[1,2,4,3], one of the choices for the game (there could be different choices) is: during the main game, the first and fourth players were chosen. The fourth player has more
Correct answer will be upvoted else downvoted. Computer science.
All arbitrary choices that are made during the title are made similarly plausible and autonomously.
For instance, assuming n=4, a=[1,2,4,3], one of the choices for the game (there could be different choices) is:
during the main game, the first and fourth players were chosen. The fourth player has more tokens, so he takes the main player's tokens. Presently a=[0,2,4,4];
during the subsequent game, the fourth and third players were chosen. They have similar number of tokens, yet arbitrarily, the third player is the champ. Presently a=[0,2,8,0];
during the third game, the second and third players were chosen. The third player has more tokens, so he requires the second player's tokens. Presently a=[0,0,10,0];
the third player is proclaimed the victor of the title.
Title champs will get customized prizes. Consequently, the adjudicators need to know ahead of time which players get an opportunity of winning, i.e have a non-no likelihood of winning the title. You have been approached to track down every such player.
Input
The main line contains one integer t (1≤t≤104) — the number of experiments. Then, at that point, t experiments follow.
The primary line of each experiment comprises of one sure integer n (1≤n≤2⋅105) — the number of players in the title.
The second line of each experiment contains n positive integers a1,a2,… ,an (1≤
It is ensured that the amount of n over all experiments doesn't surpass 2⋅105.
Output
For each experiment, print the number of players who have a nonzero likelihood of winning the title. On the following line print the numbers of these players in expanding request. Players are numbered beginning from one as per the pattern in which where they show up in the input.
Step by step
Solved in 4 steps with 1 images