A championship is held in Berland, in which $n$ players participate. The player with the number $i$ has $a_i$ ($a_i \ge 1$) tokens.

The championship consists of $n-1$ games, which are played according to the following rules:

in each game, two random players with non-zero tokens are selected;

the player with more tokens is considered the winner of the game (in case of a tie, the winner is chosen randomly);

the winning player takes all of the loser's tokens;

The last player with non-zero tokens is the winner of the championship.

All random decisions that are made during the championship are made equally probable and independently.

For example, if $n=4$, $a = [1, 2, 4, 3]$, then one of the options for the game (there could be other options) is:

during the first game, the first and fourth players were selected. The fourth player has more tokens, so he takes the first player's tokens. Now $a = [0, 2, 4, 4]$;

during the second game, the fourth and third players were selected. They have the same number of tokens, but in a random way, the third player is the winner. Now $a = [0, 2, 8, 0]$;

during the third game, the second and third players were selected. The third player has more tokens, so he takes the second player's tokens. Now $a = [0, 0, 10, 0]$;

the third player is declared the winner of the championship.

Championship winners will receive personalized prizes. Therefore, the judges want to know in advance which players have a chance of winning, i.e have a non-zero probability of winning the championship. You have been asked to find all such players.


-----Input-----

The first line contains one integer $t$ ($1 \le t \le 10^4$) — the number of test cases. Then $t$ test cases follow.

The first line of each test case consists of one positive integer $n$ ($1 \le n \le 2 \cdot 10^5$) — the number of players in the championship.

The second line of each test case contains $n$ positive integers $a_1, a_2, \ldots, a_n$ ($1 \le a_i \le 10^9$) — the number of tokens the players have.

It is guaranteed that the sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.


-----Output-----

For each test case, print the number of players who have a nonzero probability of winning the championship. On the next line print the numbers of these players in increasing order. Players are numbered starting from one in the order in which they appear in the input.


-----Examples-----

Input
2
4
1 2 4 3
5
1 1 1 1 1
Output
3
2 3 4 
5
1 2 3 4 5


-----Note-----

None

Difficulty: MEDIUM
Tags: Sorting

Data structures

Greedy algorithms
Skill types: Sorting

Data structures

Greedy algorithms

Starter code:

Solutions:
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	args = list(map(int, input().split()))
	players = [(i + 1, args[i]) for i in range(n)]
	players.sort(key=lambda x: x[1])
	s = 0
	cur = 0
	for i in range(n - 1):
		s += players[i][1]
		if s < players[i + 1][1]:
			cur = i + 1
	ans = []
	for i in range(cur, n):
		ans.append(players[i][0])
	ans.sort()
	print(len(ans))
	print(*ans)


for _ in range(int(input())):
	n = int(input())
	l = [*map(int, input().split())]
	lis = []
	for i in range(n):
		lis.append((l[i], i + 1))
	lis.sort()
	lk = []
	for i in range(n):
		lk.append(lis[i][1])
	li = sorted(l)
	s = 0
	b = -1
	for i in range(n):
		if i >= 1:
			if li[i] > s:
				b = i
		s += li[i]
	print(min(n - b, n))
	if b == -1:
		print(*sorted(lk))
	else:
		print(*sorted(lk[b:]))


answers = []

def solve(n, arr):
	if n == 1:
		answers.append([1])
		return
	newArr = []
	for (i, ele) in enumerate(arr):
		newArr.append([ele, i])
	newArr.sort()
	cum = [newArr[0][0]]
	for i in range(1, n):
		curr = newArr[i][0] + cum[-1]
		cum.append(curr)
	final = [newArr[-1][1] + 1]
	for i in range(n - 2, -1, -1):
		if cum[i] >= newArr[i + 1][0]:
			final.append(newArr[i][1] + 1)
		else:
			final.sort()
			answers.append(final)
			return
	final.sort()
	answers.append(final)
T = int(input())
while T:
	n = int(input())
	arr = [int(x) for x in input().split()]
	solve(n, arr)
	T -= 1
for ans in answers:
	print(len(ans))
	print(*ans)


t = int(input())
for i in range(t):
	n = int(input())
	q = list(map(int, input().split()))
	f = list(sorted(q))
	f.reverse()
	sumi = sum(f)
	number = 1
	listo = []
	for j in range(len(f)):
		if f[j] >= sumi // 2 + 1:
			number = f[j]
			break
		sumi = sumi - f[j]
	k = 0
	for c in range(n):
		if q[c] >= number:
			listo.append(c + 1)
			k = k + 1
	print(k)
	print(*listo, sep=' ')


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log2, ceil
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from bisect import insort
from collections import Counter
from collections import deque
from heapq import heappush, heappop, heapify
from itertools import permutations, combinations
from itertools import accumulate as ac
mod = int(1000000000.0) + 7
ip = lambda : int(stdin.readline())
inp = lambda : map(int, stdin.readline().split())
ips = lambda : stdin.readline().rstrip()
out = lambda x: stdout.write(str(x) + '\n')
t = ip()
for _ in range(t):
	n = ip()
	arr = list(inp())
	index = [i for i in range(n)]
	(arr, index) = zip(*sorted(zip(arr, index)))
	stack = [index[0]]
	p = arr[0]
	for i in range(1, n):
		if p >= arr[i]:
			p += arr[i]
			stack.append(index[i])
		else:
			p += arr[i]
			stack = [index[i]]
	ans = sorted(list(stack))
	ans = [i + 1 for i in ans]
	print(len(ans))
	print(*ans)


def main():
	for i in range(int(input())):
		(allTokens, playersWithSameTokens, nTokens, tokens) = case1490e()
		print(playersWithWinningChance(allTokens, playersWithSameTokens, nTokens, tokens))

def case1490e():
	(nPlayers, tempTokens) = (input(), map(int, input().split()))
	(allTokens, playersWithSameTokens, nTokens) = (0, {}, 0)
	for (iPlayer, token) in enumerate(tempTokens):
		allTokens += token
		if token not in playersWithSameTokens:
			playersWithSameTokens[token] = [1, iPlayer + 1]
			nTokens += 1
		else:
			playersWithSameTokens[token].append(iPlayer + 1)
			playersWithSameTokens[token][0] += 1
	tokens = sorted(playersWithSameTokens, reverse=True)
	return (allTokens, playersWithSameTokens, nTokens, tokens)

def playersWithWinningChance(allTokens, playersWithSameTokens, nTokens, tokens):
	(nWinners, winners) = (playersWithSameTokens[tokens[0]][0], playersWithSameTokens[tokens[0]][1:])
	allTokens -= nWinners * tokens[0]
	for i in range(1, nTokens):
		if allTokens < tokens[i - 1]:
			break
		nWinners += playersWithSameTokens[tokens[i]][0]
		winners.extend(playersWithSameTokens[tokens[i]][1:])
		allTokens -= playersWithSameTokens[tokens[i]][0] * tokens[i]
	winners.sort()
	return f"{nWinners}\n{' '.join(map(str, winners))}"
main()


class solution:

	def __init__(self, n, arr):
		self.n = n
		self.org = arr
		self.arr = sorted(arr)

	def checker(self, l, r):
		sum = 0
		for i in range(0, l + 1):
			sum += self.arr[i]
		for i in range(l + 1, r + 1, 1):
			if sum >= self.arr[i]:
				sum += self.arr[i]
			else:
				return False
		return True

	def solve(self):
		l = 0
		r = self.n - 1
		mid = (l + r) // 2
		result = -1
		while mid != l and mid != r:
			if self.checker(mid, self.n - 1) == True:
				r = mid
			else:
				l = mid
			mid = (l + r) // 2
		if self.checker(r, self.n - 1) == True:
			result = r
		if self.checker(l, self.n - 1) == True:
			result = l
		for i in range(0, self.n):
			if self.org[i] >= self.arr[result]:
				yield (i + 1)
		print(self.n - 1 - result + 1)
for _ in range(0, int(input())):
	print(*sorted(solution(int(input()), list(map(int, input().split()))).solve()), sep=' ')


for _ in range(int(input())):
	n = int(input())
	nums = list(enumerate(list(map(int, input().split())), 1))
	nums.sort(key=lambda x: x[1])
	sum = 0
	pre = []
	start = 0
	for i in range(len(nums)):
		sum += nums[i][1]
		pre.append(sum)
	for i in range(0, len(pre) - 1):
		if pre[i] < nums[i + 1][1]:
			start = i + 1
	lst = []
	for j in range(start, len(nums)):
		lst.append(nums[j][0])
	lst.sort()
	print(len(lst))
	print(*lst)


import sys

def debug(*args):
	print(*args, file=sys.stderr)

def read_str():
	return sys.stdin.readline().strip()

def read_int():
	return int(sys.stdin.readline().strip())

def read_ints():
	return map(int, sys.stdin.readline().strip().split())

def read_str_split():
	return list(sys.stdin.readline().strip())

def read_int_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def Main():
	t = read_int()
	for _ in range(t):
		n = read_int()
		a = read_int_list()
		arr1 = [(x, i) for (i, x) in enumerate(a, start=1)]
		arr1.sort()
		idx = 0
		total = 0
		for i in range(n - 1):
			total += arr1[i][0]
			if total < arr1[i + 1][0]:
				idx = i + 1
		ans = [y for (x, y) in arr1[idx:]]
		ans.sort()
		print(len(ans))
		print(*ans)
Main()


for _ in range(int(input())):
	n = int(input())
	a = [*map(int, input().split())]
	s = sum(a)
	temp = 0
	a = sorted(zip(a, range(1, n + 1)))
	possible_ind = []
	ans = 0
	for (num, ind) in a[::-1]:
		if s >= temp:
			ans += 1
			possible_ind.append(ind)
			s -= num
			temp = num
		else:
			break
	print(ans)
	print(*sorted(possible_ind))


from sys import stdin
from collections import Counter

def arrayinput():
	return [int(x) for x in stdin.readline().split()]

def integerinput():
	return int(stdin.readline())

def stringinput():
	return stdin.readline()

def twonumberinput():
	return map(int, stdin.readline().split())

def stringrarray():
	return stdin.readline().split(' ')

def Convert(string):
	list1 = []
	list1[:0] = string
	return list1

def binary(arr, x):
	l = 0
	u = len(arr) - 1
	while l <= u:
		mid = (l + u) // 2
		if mid == len(arr) - 1:
			if x < arr[mid]:
				return mid - 1
			else:
				return -1
		if arr[mid] <= x and x < arr[mid + 1]:
			return mid
		if arr[mid + 1] == x:
			return mid + 1
		if arr[mid] < x:
			l = mid + 1
		if arr[mid] > x:
			u = mid - 1
	return -1
for i in range(integerinput()):
	integerinput()
	a = arrayinput()
	b = a[:]
	b.sort()
	c = []
	x = 0
	for i in b:
		x = x + i
		c.append(x)
	x = 0
	for i in range(len(b)):
		x = c[i]
		flag = 0
		while True:
			y = binary(b, x)
			if y == -1:
				break
			if y == len(b) - 1:
				break
			if c[y] < b[y + 1] or y == -2:
				flag = 1
				break
			else:
				x = c[y]
				continue
		if flag == 0:
			y = b[i]
			break
	c = []
	for j in range(len(a)):
		if a[j] >= y:
			c.append(j + 1)
	print(len(c))
	print(*c, sep=' ')


I = input
for _ in ' ' * int(I()):
	n = int(I())
	l = sorted(zip(map(int, I().split()), range(1, n + 1)))
	s = l[0][0]
	a = 0
	for i in range(1, n):
		if s < l[i][0]:
			a = i
		s += l[i][0]
	print(len(l[a:]))
	print(*[x[1] for x in sorted(l[a:], key=lambda x: x[1])])


for i in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	brr = arr.copy()
	brr.sort()
	ans = []
	p = brr[0]
	k = 0
	for i in range(1, n):
		if p < brr[i]:
			k = i
		p = p + brr[i]
	for i in range(0, n):
		if brr[k] <= arr[i]:
			ans.append(i + 1)
	print(len(ans))
	print(*ans)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = a.copy()
	a.sort()
	l = a.copy()
	for i in range(1, n):
		l[i] += l[i - 1]
	ans = 1
	i = n - 2
	for i in range(n - 2, -1, -1):
		if l[i] >= a[i + 1]:
			ans += 1
		else:
			break
	mn = a[i + 1]
	print(ans)
	for i in range(n):
		if b[i] >= mn:
			print(i + 1, end=' ')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	ls_ = [int(i) for i in input().split()]
	ls = sorted(ls_)
	res_ind = 0
	left = -1
	right = n - 1
	while right - left > 1:
		middle = (left + right) // 2
		tmp_n = ls[middle]
		flag = True
		for j in range(n):
			if middle == j:
				continue
			if tmp_n < ls[j]:
				flag = False
				break
			tmp_n += ls[j]
		if flag:
			right = (left + right) // 2
		else:
			left = (left + right) // 2
	ans = [i + 1 for i in range(n) if ls_[i] >= ls[right]]
	ans.sort()
	print(len(ans))
	print(*sorted(ans))


import collections
import math
from heapq import *
import bisect
for _ in range(int(input())):
	n = int(input())
	nums = list(map(int, input().split()))
	val = sorted(nums)
	out = set([i + 1 for i in range(n)])
	pre = 0
	index = -1
	for i in range(n - 1):
		if pre + val[i] < val[i + 1]:
			index = i
		pre += val[i]
	if index == -1:
		print(n)
		print(*[i + 1 for i in range(n)])
		continue
	remove = set(val[:index + 1])
	for i in range(n):
		if nums[i] in remove:
			out.remove(i + 1)
	print(len(out))
	print(*out)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = [(int(i), index) for (index, i) in enumerate(input().split(), 1)]
	arr.sort(reverse=True)
	ans_list = [arr[0][1]]
	s = sum([i[0] for i in arr]) - arr[0][0]
	for i in range(1, n):
		if s < arr[i - 1][0]:
			break
		s -= arr[i][0]
		ans_list.append(arr[i][1])
	ans_list.sort()
	print(len(ans_list))
	print(' '.join((str(i) for i in ans_list)))


for _ in range(int(input())):
	n = int(input())
	A = list(map(int, input().split()))
	B = A.copy()
	A.sort()
	temp = A[0]
	idx = 0
	for i in range(1, n):
		if temp < A[i]:
			idx = i
		temp += A[i]
	ans = []
	for i in range(n):
		if B[i] >= A[idx]:
			ans.append(i + 1)
	print(len(ans))
	print(*ans)


import itertools

def main():
	t = int(input())
	result = []
	for _ in range(t):
		n = int(input())
		a = map(int, input().split())

		def enumerate_a(arr):
			i = 0
			for val in arr:
				yield (val, i)
				i += 1
		a = sorted(enumerate_a(a))
		s = 0
		sums = [0] * n
		for i in range(n):
			s += a[i][0]
			sums[i] = s
		ans_n = 1
		fits = [False] * n
		fits[a[n - 1][1]] = True
		for i in range(n - 1 - 1, -1, -1):
			if sums[i] < a[i + 1][0]:
				break
			ans_n += 1
			fits[a[i][1]] = True
		ans = f'{ans_n}\n'
		for (i, v) in enumerate(fits):
			if v:
				ans += f'{i + 1} '
		result.append(ans)
	print('\n'.join(result))
main()


for ad in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	s = sum(l)
	x = []
	for i in range(n):
		x.append([l[i], i])
	x = sorted(x, key=lambda a: a[0], reverse=True)
	ans = []
	ans.append(x[0][1] + 1)
	for i in range(1, n):
		s -= x[i - 1][0]
		if s >= x[i - 1][0] and ans[-1] == x[i - 1][1] + 1:
			ans.append(x[i][1] + 1)
	ans.sort()
	print(len(ans))
	print(*ans)


from copy import deepcopy

def win(pos, a):
	power = a[pos]
	for i in range(len(a)):
		if i == pos:
			continue
		if power < a[i]:
			return False
		power += a[i]
	return True
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	a = list(map(int, input().split(' ')))
	b = deepcopy(a)
	a.sort()
	l = -1
	r = n - 1
	while r - l > 1:
		m = (l + r) // 2
		if win(m, a):
			r = m
		else:
			l = m
	winIds = []
	for i in range(n):
		if b[i] >= a[r]:
			winIds.append(i + 1)
	print(len(winIds))
	print(*winIds)


import collections
import string
import math
import copy
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
mo = 998244353

def exgcd(a, b):
	if not b:
		return (1, 0)
	(y, x) = exgcd(b, a % b)
	y -= a // b * x
	return (x, y)

def getinv(a, m):
	(x, y) = exgcd(a, m)
	return --1 if x == 1 else x % m

def comb(n, b):
	res = 1
	b = min(b, n - b)
	for i in range(b):
		res = res * (n - i) * getinv(i + 1, mo) % mo
	return res % mo

def quickpower(a, n):
	res = 1
	while n:
		if n & 1:
			res = res * a % mo
		n >>= 1
		a = a * a % mo
	return res

def dis(a, b):
	return abs(a[0] - b[0]) + abs(a[1] - b[1])

def getpref(x):
	if x > 1:
		return x * (x - 1) >> 1
	else:
		return 0

def orafli(upp):
	primes = []
	marked = [False for i in range(upp + 3)]
	for i in range(2, upp):
		if not marked[i]:
			primes.append(i)
		for j in primes:
			if i * j >= upp:
				break
			marked[i * j] = True
			if i % j == 0:
				break
	return primes

def solve():
	n = int(input())
	li = [(int(i), p) for (p, i) in enumerate(input().split())]
	li.sort()
	ans = []
	su = sum((i[0] for i in li))
	ss = su
	for (i, p) in li[::-1]:
		su -= i
		ans.append(p + 1)
		if su < i:
			break
	ans.sort()
	print(len(ans))
	print(*ans)
t = int(input())
for ti in range(t):
	solve()


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = a.copy()
	b.sort()
	s = 0
	ans = 0
	for i in range(n):
		if b[i] > s:
			ans = i
		s += b[i]
	pos = b[i:]
	ns = []
	for j in range(n):
		if a[j] >= b[ans]:
			ns.append(str(j + 1))
	print(n - ans)
	print(' '.join(ns))


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
inp = lambda : list(map(int, sys.stdin.readline().rstrip('\r\n').split()))
mod = 10 ** 9 + 7
Mod = 998244353
INF = float('inf')
sys.setrecursionlimit(2 * 10 ** 5 + 100)
tc = 1
(tc,) = inp()
for _ in range(tc):
	(n,) = inp()
	a = inp()
	b = sorted(range(n), key=lambda x: a[x])
	pre = [a[b[0]]]
	for i in range(1, n):
		pre.append(pre[-1] + a[b[i]])
	win = [False] * n
	win[-1] = True
	for i in range(n - 2, -1, -1):
		if a[b[i + 1]] <= pre[i]:
			win[i] = win[i + 1]
	ans = [b[i] + 1 for i in range(n) if win[i]]
	print(len(ans))
	if ans:
		print(*sorted(ans))


from io import BytesIO, IOBase
import sys, os
inpl = lambda : list(map(int, input().split()))
inpm = lambda : map(int, input().split())
inpi = lambda : int(input())
inp = lambda : input()
(rev, ra, l) = (reversed, range, len)
P = print
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
import sys, operator, math
from collections import Counter
tc = inpi()
while tc:
	n = inpi()
	li = inpl()
	li1 = []
	for i in ra(n):
		li1.append([li[i], i])
	li1.sort()
	pre = [0] * n
	pre[0] = li1[0][0]
	omap = {}
	for i in range(1, n):
		if li[i - 1] == li[i]:
			if li1[i][1] in omap:
				omap.append(li1[i - 1][1])
			else:
				omap[li1[i][1]] = [li1[i - 1][1]]
		pre[i] += pre[i - 1] + li1[i][0]
	dp = [0] * n
	dp[-1] = 1
	for i in reversed(ra(n - 1)):
		if pre[i] >= li1[i + 1][0]:
			dp[i] = dp[i + 1]
	ans = []
	c = 0
	for i in ra(n):
		if dp[i] == 1:
			c += 1
			ans.append(li1[i][1] + 1)
	ans.sort()
	ans = set(ans)
	P(c)
	P(*ans)
	tc -= 1


from sys import stdin
input = stdin.readline
from heapq import heapify, heappush, heappop, heappushpop
from collections import defaultdict as dd, deque as dq, Counter as C
from math import factorial as f, ceil, gcd, sqrt, log
from bisect import bisect_left as bl, bisect_right as br
from itertools import combinations as c, permutations as p
from math import factorial as f, ceil, gcd, sqrt, log
mi = lambda : map(int, input().split())
ii = lambda : int(input())
li = lambda : list(map(int, input().split()))
mati = lambda r: [li() for _ in range(r)]
lcm = lambda a, b: a * b // gcd(a, b)

def solve():
	n = ii()
	arr = li()
	p = []
	for (a, b) in enumerate(arr):
		p.append((b, a))
	p.sort(reverse=True)
	ans = []
	s = sum(arr)
	for x in range(n):
		if x == n - 1:
			if s == p[x][0]:
				ans.append(p[x][1] + 1)
		else:
			s -= p[x][0]
			if s < p[x][0]:
				ans.append(p[x][1] + 1)
				break
			else:
				ans.append(p[x][1] + 1)
	ans.sort()
	print(len(ans))
	print(*ans)
for _ in range(ii()):
	solve()


import sys, os, io
import math
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
for _ in range(int(input())):
	n = int(input())
	a1 = [int(i) for i in input().split()]
	a = []
	for i in range(len(a1)):
		a.append([a1[i], i])
	a.sort()
	b = [0] * n
	c = [0] * n
	pref = [a[0][0]]
	for i in range(1, n):
		pref.append(pref[-1] + a[i][0])
	for i in range(n - 1):
		if pref[i] >= a[i + 1][0]:
			c[i] = 1
	ind = -1
	c[-1] = 1
	for i in range(n - 1, -1, -1):
		if c[i] == 0:
			ind = i
			break
	for i in range(ind + 1, n):
		b[a[i][1]] = 1
	b[a[-1][1]] = 1
	print(b.count(1))
	for i in range(n):
		if b[i] == 1:
			print(i + 1, end=' ')
	print()


import sys
YES = 'YES'
NO = 'NO'
MOD = 1000000007

def input_int():
	return int(input())

def input_list():
	return input().split(' ')

def input_list_int():
	return list(map(int, input_list()))

def solve():
	n = input_int()
	a = input_list_int()
	ad = {}
	for i in range(0, n):
		ad[i] = a[i]
	ad = sorted(ad.items(), key=lambda x: x[1])
	s = [0] * n
	s[0] = ad[0][1]
	for i in range(1, n):
		s[i] = s[i - 1] + ad[i][1]
	res = []
	for i in range(n - 2, -1, -1):
		if s[i] >= ad[i + 1][1]:
			res.append(ad[i][0] + 1)
		else:
			break
	res.append(ad[n - 1][0] + 1)
	res.sort()
	print(len(res))
	for i in res:
		print(i, end=' ')
	print()
query_count = input_int()
while query_count:
	query_count -= 1
	solve()


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	lis = []
	for i in range(n):
		lis.append([arr[i], i])
	lis.sort()
	i = 0
	j = 1
	s = lis[0][0]
	while i < n and j < n:
		if s >= lis[j][0]:
			s += lis[j][0]
			j += 1
		elif s < lis[j][0]:
			s += lis[j][0]
			i = j
			j += 1
	print(n - i)
	ans = []
	for k in range(i, n):
		ans.append(lis[k][1] + 1)
	ans.sort()
	print(*ans)


t = int(input())
while t != 0:
	n = int(input())
	list1 = list(map(int, input().split()))
	for i in range(len(list1)):
		list1[i] = [list1[i], i]
	list1.sort()
	pref = [0 for i in range(len(list1))]
	pref[0] = list1[0][0]
	for i in range(1, n):
		pref[i] = pref[i - 1] + list1[i][0]
	ans = []
	ans.append(list1[-1][1] + 1)
	for i in range(len(pref) - 2, -1, -1):
		if pref[i] >= list1[i + 1][0]:
			ans.append(list1[i][1] + 1)
		else:
			break
	ans.sort()
	print(len(ans))
	print(*ans)
	t -= 1


import math
import math
from collections import defaultdict, Counter
from itertools import permutations

def fact(n):
	return 1 if n == 1 or n == 0 else n * fact(n - 1)

def prime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def inp():
	l = list(map(int, input().split()))
	return l

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	l = [1]
	for p in range(2, n + 1):
		if prime[p]:
			l.append(p)
	return l

def main():
	for _ in range(int(input())):
		n = int(input())
		l = inp()
		a = sorted(l)
		val = a[0]
		ll = []
		start = a[0]
		for i in range(1, n):
			if a[i] <= val:
				val += a[i]
			else:
				start = a[i]
				val += a[i]
		for i in range(n):
			if l[i] >= start:
				ll.append(i + 1)
		print(len(ll))
		print(*ll)
import os, sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()

def random():
	rating = 100
	rating = rating * 100
	rating = rating * 100
	print(rating)

def random():
	rating = 100
	rating = rating * 100
	rating = rating * 100
	print(rating)

def random():
	rating = 100
	rating = rating * 100
	rating = rating * 100
	print(rating)

def random():
	rating = 100
	rating = rating * 100
	rating = rating * 100
	print(rating)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = [0 for _ in range(n + 2)]
	for i in range(0, n):
		b[i] = a[i]
	a.sort()

	def check(pos):
		x = a[pos]
		for i in range(0, n):
			if i != pos:
				if x >= a[i]:
					x += a[i]
				else:
					return False
		return True
	dau = 0
	cuoi = n - 1
	ans = 0
	while dau <= cuoi:
		mid = dau + cuoi >> 1
		if check(mid):
			ans = mid
			cuoi = mid - 1
		else:
			dau = mid + 1
	cnt = 0
	for i in range(0, n):
		if b[i] >= a[ans]:
			cnt += 1
	print(cnt)
	for i in range(0, n):
		if b[i] >= a[ans]:
			print(i + 1, end=' ')
	print()


import os
import sys
from io import BytesIO, IOBase

def main():
	for _ in range(int(input())):
		n = int(input())
		a = list(map(int, input().split()))
		l = list()
		for (i, item) in enumerate(a):
			l.append([item, i + 1])
		l.sort()
		ans = [0] * n
		ans[0] = l[0][0]
		for i in range(1, n):
			temp = l[i][0]
			if ans[i - 1] < temp:
				ans[i] = temp + ans[i - 1]
				ans[i - 1] = 0
			else:
				ans[i] = temp + ans[i - 1]
		flag = 1
		for i in range(n - 1, -1, -1):
			if not flag:
				ans[i] = 0
			elif ans[i] == 0:
				flag = 0
			else:
				pass
		final = []
		temp = 0
		flag = 0
		for i in range(n):
			if flag:
				temp += 1
				final.append(l[i][1])
				continue
			if ans[i] != 0:
				flag = 1
				temp += 1
				final.append(l[i][1])
		print(temp)
		final.sort()
		print(*final)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a_set = sorted(list(set(a)))
	win_dict = {}.fromkeys(a_set, 0)
	count_dict = {}.fromkeys(a_set, 0)
	for num in a:
		count_dict[num] += 1
	prefix_sum_dict = {}.fromkeys(a_set, 0)
	if len(a_set) == 1:
		print(n)
		ans_str = ''
		for i in range(1, n + 1):
			ans_str += str(i) + ' '
		print(ans_str[:-1])
	else:
		prefix_sum = 0
		for i in range(len(a_set)):
			prefix_sum += count_dict[a_set[i]] * a_set[i]
			prefix_sum_dict[a_set[i]] = prefix_sum
		for i in reversed(range(len(a_set) - 1)):
			if prefix_sum_dict[a_set[i]] >= a_set[i + 1]:
				win_dict[a_set[i]] = 1
			else:
				break
		win_dict[a_set[-1]] = 1
		ans = 0
		ans_str = ''
		for index in range(len(a)):
			if win_dict[a[index]] == 1:
				ans += 1
				ans_str += str(index + 1) + ' '
		print(ans)
		print(ans_str[:-1])


for t in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	lst = [list(a) for a in zip(lst, [x + 1 for x in range(n)])]
	lst.sort()
	pref = 0
	ans = []
	for (value, idx) in lst:
		if pref < value:
			ans = []
		pref += value
		ans.append(idx)
	ans.sort()
	print(len(ans))
	print(*ans)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	get = list(map(int, input().split()))
	tokens = [(get[i], i) for i in range(n)]
	srt = sorted(tokens)
	cal = 0
	lose_until = -1
	for i in range(n - 1):
		cal += srt[i][0]
		if cal < srt[i + 1][0]:
			lose_until = i
	ans = srt[lose_until + 1:]
	leng = len(ans)
	e = []
	for i in range(leng):
		e.append(ans[i][1] + 1)
	print(leng)
	e.sort()
	print(*e)


__version__ = '1.0'
__date__ = '2021-03-13'
import sys

def solve(n, a):
	ordered = sorted([(a[i], i) for i in range(n)])
	sums = [each[0] for each in ordered]
	for i in range(1, n):
		sums[i] += sums[i - 1]
	answers = [ordered[-1][1] + 1]
	for i in reversed(range(1, n)):
		if ordered[i][0] > sums[i - 1]:
			break
		else:
			answers.append(ordered[i - 1][1] + 1)
	return sorted(answers)

def main(argv=None):
	t = int(input())
	for _ in range(t):
		n = int(input())
		a = list(map(int, input().split()))
		ans = solve(n, a)
		print(len(ans))
		print(' '.join(map(str, ans)))
	return 0
STATUS = main()
sys.exit(STATUS)


t = int(input())
for test in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr = [[arr[i], i] for i in range(len(arr))]
	arr.sort()
	prefixSum = 0
	for i in range(n):
		prefixSum += arr[i][0]
	s = set()
	s.add(arr[-1][1] + 1)
	for j in range(n - 2, -1, -1):
		prefixSum -= arr[j + 1][0]
		if prefixSum < arr[j + 1][0]:
			break
		else:
			s.add(arr[j][1] + 1)
	s = list(s)
	s.sort()
	print(len(s))
	for k in s:
		print(k, end=' ')
	print('\r')


import sys
input = sys.stdin.readline

def main():
	n = int(input())
	alst = list(map(int, input().split()))
	blst = sorted(alst)
	l = -1
	r = n - 1
	while r - l > 1:
		mid = (r + l) // 2
		total = sum(blst[:mid + 1])
		for i in range(mid + 1, n):
			if blst[i] > total:
				l = mid
				break
			total += blst[i]
		else:
			r = mid
	th = blst[r]
	ans = []
	for (i, a) in enumerate(alst, 1):
		if a >= th:
			ans.append(i)
	print(len(ans))
	print(*ans)
for _ in range(int(input())):
	main()


import sys
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
input = sys.stdin.readline
t = 1
t = int(input())
while t:
	t -= 1
	n = int(input())
	a = list(map(int, input().split()))
	a = [(a[i], i) for i in range(n)]
	a.sort()
	curr = a[0][0]
	notpossible = 0
	for i in range(1, n):
		if a[i][0] > curr:
			notpossible = i
		curr += a[i][0]
	print(n - notpossible)
	print(*sorted([a[i][1] + 1 for i in range(notpossible, n)]))


def solve():
	n = int(input())
	ch = input()
	L = [int(i) for i in ch.split()]
	T = L.copy()
	L.sort()
	I = L.copy()
	test = [0] * n
	if n == 1:
		print(1)
		print(1)
		return 0
	for i in range(1, n):
		if I[i - 1] >= I[i]:
			test[i - 1] = 1
		I[i] += I[i - 1]
	x = L[-1]
	nb = 1
	i = n - 2
	while i >= 0 and test[i] == 1:
		x = L[i]
		nb += 1
		i -= 1
	X = []
	for i in range(n):
		if T[i] >= x:
			X.append(i + 1)
	ch = ''
	X.sort()
	print(len(X))
	for i in X:
		ch += str(i) + ' '
	print(ch)
t = int(input())
for q in range(t):
	solve()


test = int(input())

def func(x):
	return x[0]

def solve():
	n = int(input())
	a = list(map(int, input().split()))
	b = []
	for i in range(len(a)):
		b.append([a[i], i + 1])
	b.sort(key=func)
	a = []
	_sum = 0
	a.append(0)
	for i in b:
		_sum += i[0]
		a.append(_sum)
	for i in range(n - 1, -1, -1):
		if b[i][0] > a[i]:
			ans = []
			for j in range(i, n):
				ans.append(b[j][1])
			ans.sort()
			print(len(ans))
			for j in ans:
				print(j, end=' ')
			print()
			return
for i in range(test):
	solve()


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a2 = sorted(zip(a, range(n)))
	start = -1
	base = 0
	for (i, xx) in enumerate(a2):
		d = xx[0]
		if base < d:
			start = i
		base = base + d
	print(n - start)
	print(' '.join(map(str, sorted((x[1] + 1 for x in a2[start:])))))


import math
import heapq

def S():
	return input()

def M():
	return map(int, input().split())

def I():
	return int(S())

def L():
	return list(M())
for _ in range(I()):
	n = I()
	ar = L()
	a = ar.copy()
	a.sort()
	s = []
	p = a[0]
	k = 0
	for i in range(1, n):
		if p < a[i]:
			k = i
		p = p + a[i]
	for i in range(0, n):
		if a[k] <= ar[i]:
			s.append(i + 1)
	print(len(s))
	print(*s)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l1 = []
	for i in range(n):
		l1.append([l[i], i + 1])
	l1.sort()
	f = [0] * n
	f[n - 1] = 1
	p = [0] * n
	p[0] = l1[0][0]
	for i in range(1, n):
		p[i] = p[i - 1] + l1[i][0]
	l3 = [l1[-1][1]]
	c = 1
	for i in range(n - 2, -1, -1):
		if p[i] >= l1[i + 1][0] and f[i + 1] == 1:
			f[i] = 1
			c += 1
			l3.append(l1[i][1])
		else:
			break
	l3.sort()
	print(c)
	print(*l3)


for gg in range(int(input())):
	n = int(input())
	s = []
	l = list(map(int, input().split()))
	for i in range(n):
		s.append([l[i], i + 1])
	s.sort()
	total = s[0][0]
	count = -1
	for i in range(1, n):
		if total >= s[i][0]:
			total += s[i][0]
			continue
		elif total < s[i][0]:
			count = i
			total += s[i][0]
	x = []
	if count == -1:
		print(n)
		for i in range(0, n):
			x.append(s[i][1])
	else:
		print(n - count)
		for i in range(count, n):
			x.append(s[i][1])
	x.sort()
	for i in x:
		print(i, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	A = list(map(int, input().split()))
	A_Copy = A[:]
	A.sort()
	(sum1, max1) = (0, 0)
	for i in range(n):
		if sum1 < A[i]:
			max1 = A[i]
		sum1 += A[i]
	ans1 = []
	for i in range(n):
		if A_Copy[i] >= max1:
			ans1.append(i + 1)
	print(len(ans1))
	print(*ans1)


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	A = list(map(int, sys.stdin.readline().split()))
	A_sorted = sorted(A)
	lowest_winner = None
	cumulative_sum = 0
	for a in A_sorted:
		if a > cumulative_sum:
			lowest_winner = a
		cumulative_sum += a
	possible_winners = [i + 1 for (i, a) in enumerate(A) if a >= lowest_winner]
	print(len(possible_winners))
	print(' '.join(map(str, possible_winners)))


from sys import stdin
input = stdin.readline

def check_win(index):
	z = b[index]
	for i in range(n):
		if i == index:
			continue
		if z >= b[i]:
			z += b[i]
			if z >= b[-1]:
				return True
		else:
			return False
	return True

def binary_search():
	l = 0
	r = n
	while l < r:
		m = l + (r - l) // 2
		if check_win(m):
			r = m
			z = m
		else:
			l = m + 1
	return b[z]
t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	b = sorted(a)
	x = binary_search()
	ans = []
	for i in range(n):
		if a[i] >= x:
			ans.append(i + 1)
	print(len(ans))
	print(*ans)


import sys
import math
input = sys.stdin.readline
mod = 10 ** 9 + 7

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
for _ in range(inp()):
	n = inp()
	l = inlt()
	x = []
	for i in range(n):
		x.append([l[i], i + 1])
	x.sort(key=lambda x: x[0])
	out = []
	s = 0
	a = []
	y = 0
	for i in range(n):
		s = s + x[i][0]
		a.append(s)
	for i in range(n - 1):
		if a[i] < x[i + 1][0]:
			y = i + 1
	for i in range(y, len(x)):
		out.append(x[i][1])
	out.sort()
	print(len(out))
	print(' '.join((str(i) for i in out)))


import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7

def solve():

	def meguru_bisect(ok, ng):
		while abs(ok - ng) > 1:
			mid = (ok + ng) // 2
			if is_ok(mid):
				ng = mid
			else:
				ok = mid
		return ng

	def is_ok(x):
		now = sum((B[i][0] for i in range(x + 1)))
		for i in range(x + 1, n):
			if now >= B[i][0]:
				now += B[i][0]
			else:
				return False
		return True
	n = int(input())
	A = list(map(int, input().split()))
	B = [[A[i], i] for i in range(n)]
	B.sort()
	limit = meguru_bisect(-1, n)
	res = [B[i][1] + 1 for i in range(n) if i >= limit]
	res.sort()
	print(len(res))
	print(*res)

def resolve():
	t = int(input())
	for _ in range(t):
		solve()
resolve()


def solve():
	n = int(input())
	a = list(map(int, input().split()))
	p = [(a[i], i + 1) for i in range(n)]
	p.sort()
	(k, m) = (0, p[0][0])
	for i in range(1, n):
		if p[i][0] > m:
			k = i
		m += p[i][0]
	s = [p[i][1] for i in range(k, n)]
	s.sort()
	print(len(s))
	print(' '.join(map(str, s)))
tests = int(input())
for test in range(tests):
	solve()


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	temp = a[:]
	ar = []
	if n == 1:
		print(1)
		print(1)
		continue
	a.sort()
	ans = 2
	if a[0] == a[1]:
		ans = 1
	sum = a[0]
	for i in range(1, n):
		if sum < a[i]:
			ans = i + 1
		sum += a[i]
	for i in range(n):
		if temp[i] >= a[ans - 1]:
			ar.append(i + 1)
	print(len(ar))
	for i in ar:
		print(i, end=' ')
	print('')


def solution():
	n = int(input())
	a = [int(i) for i in input().split()]
	sorted_a = sorted(a)
	sums = [sorted_a[0]]
	last = sorted_a[0]
	for i in range(1, n):
		sums.append(sums[i - 1] + sorted_a[i])
		if sums[i - 1] < sorted_a[i]:
			last = sorted_a[i]
	ans = []
	for i in range(n):
		if a[i] >= last:
			ans.append(i + 1)
	print(len(ans))
	print(*ans)
for t in range(int(input())):
	solution()


from sys import stdin, stdout
input = stdin.readline

def im():
	return map(int, input().split())

def ii():
	return int(input())

def il():
	return list(map(int, input().split()))

def ins():
	return input()[:-1]
for _ in range(ii()):
	n = ii()
	lis = il()
	arr = [[lis[i], i + 1] for i in range(n)]
	arr.sort(key=lambda x: x[0])
	pre = []
	sm = 0
	ans = []
	for i in range(n):
		pre.append(sm + arr[i][0])
		sm = sm + arr[i][0]
	for i in range(n - 1):
		if pre[i] >= arr[i + 1][0]:
			ans.append(arr[i][1])
		else:
			ans = []
	ans.append(arr[-1][1])
	ans.sort()
	print(len(ans))
	print(*ans)


def codeforces(arr):
	dist = {}
	ind = 1
	for i in arr:
		try:
			dist[i].append(ind)
		except:
			dist[i] = [ind]
		ind += 1
	arr.sort()
	ind = -1
	res = 0
	start = 0
	for i in arr:
		if res < i:
			start = ind + 1
		res += i
		ind += 1
	ans = []
	for i in range(start, len(arr)):
		ans.append(dist[arr[i]].pop())
	ans.sort()
	print(len(ans))
	s = ' '.join(map(str, ans))
	print(s)
t = int(input())
for test in range(t):
	n = int(input())
	arr = [int(i) for i in input().split()]
	codeforces(arr)


def solve(arr, n, ans):
	total = sum(arr)
	indices = []
	for i in range(n):
		indices.append((arr[i], i))
	indices.sort()
	dp = [False] * n
	dp[-1] = True
	total -= indices[-1][0]
	ans_arr = [indices[-1][1] + 1]
	for i in range(n - 2, -1, -1):
		if total >= indices[i + 1][0] and dp[i + 1]:
			dp[i] = True
			ans_arr.append(indices[i][1] + 1)
		total -= indices[i][0]
	ans_arr.sort()
	for i in range(len(ans_arr)):
		ans_arr[i] = str(ans_arr[i])
	ans.append(str(len(ans_arr)))
	ans.append(' '.join(ans_arr))

def main():
	t = int(input())
	ans = []
	for i in range(t):
		n = int(input())
		arr = list(map(int, input().split()))
		solve(arr, n, ans)
	print('\n'.join(ans))
main()


for _ in range(int(input())):
	n = int(input())
	ai = list(map(int, input().split()))
	for (i, v) in enumerate(ai):
		ai[i] = (v, i)
	ai.sort()
	pref = []
	out = []
	cur = 0
	for i in range(n):
		cur += ai[i][0]
		pref.append(cur)
	out = [ai[-1][1] + 1]
	for i in range(n - 2, -1, -1):
		if pref[i] >= ai[i + 1][0]:
			out.append(ai[i][1] + 1)
		else:
			break
	print(len(out))
	out.sort()
	print(*out)


def ans(a, n):
	d = {}
	for i in range(len(a)):
		if a[i] not in d:
			d[a[i]] = [i]
		else:
			d[a[i]].append(i)
	a.sort()
	s = [0 for i in range(n)]
	ans = 0
	arr = []
	s[0] = a[0]
	for i in range(1, n):
		s[i] = s[i - 1] + a[i]
	for i in range(n - 1):
		if s[i] >= a[i + 1]:
			ans += 1
			arr.append(a[i])
		else:
			ans = 0
			arr = []
	ans += 1
	arr.append(a[-1])
	print(ans)
	l = []
	for i in arr:
		l.append(d[i].pop() + 1)
	l.sort()
	for i in l:
		print(i, end=' ')
	print('')
n = int(input())
for i in range(n):
	m = int(input())
	b = input().split()
	a = []
	for i in b:
		a.append(int(i))
	ans(a, m)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	res = [0 for i in range(n)]
	su = []
	s = 0
	a = [[a[i], i] for i in range(n)]
	a.sort()
	for i in range(n):
		s += a[i][0]
		su.append(s)
	p = -2
	for i in range(n - 1):
		if su[i] < a[i + 1][0]:
			p = i
	for i in range(p + 1):
		res[a[i][1]] = 0
	for i in range(p + 1, n):
		res[a[i][1]] = 1
	k = [i + 1 for i in range(n) if res[i] != 0]
	print(len(k))
	print(*k)


for _ in range(int(input())):
	input()
	arr = map(int, input().split())
	u = sorted(((a, i) for (i, a) in enumerate(arr, 1)))
	cur = 0
	res = []
	for (a, i) in u:
		if cur < a:
			res.clear()
		res.append(i)
		cur += a
	print(len(res))
	print(*sorted(res))


def take_first(elem):
	return elem[0]
q = int(input())
while q > 0:
	n = int(input())
	a = input().split()
	b = []
	for i in range(n):
		p = []
		p.append(int(a[i]))
		p.append(i)
		b.append(p)
	sorted_list = sorted(b, key=take_first)
	sorted_list[0].append(sorted_list[0][0])
	for i in range(1, n):
		sorted_list[i].append(sorted_list[i - 1][2] + sorted_list[i][0])
	ans = []
	ans.append(sorted_list[n - 1][1] + 1)
	i = n - 2
	while i >= 0:
		if sorted_list[i][2] < sorted_list[i + 1][0]:
			break
		ans.append(sorted_list[i][1] + 1)
		i = i - 1
	ans.sort()
	print(len(ans))
	for i in ans:
		print(i, end=' ')
	print()
	q = q - 1


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l1 = l + []
	l1.sort(reverse=True)
	s = sum(l)
	c = 0
	for i in l1:
		s -= i
		c += 1
		if i > s:
			break
	print(c)
	ans = []
	for j in range(n):
		if l[j] >= i:
			ans.append(j + 1)
	ans.sort()
	print(*ans)


for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	player = [[a[i - 1], i] for i in range(1, n + 1)]
	player = sorted(player, key=lambda x: x[0])
	currPlayer = player[-1][0]
	tokenCount = sum(a) - currPlayer
	winners = [player[-1][-1]]
	i = 2
	while i <= n and tokenCount >= currPlayer:
		currPlayer = player[-i][0]
		winners.append(player[-i][-1])
		tokenCount -= currPlayer
		i += 1
	print(len(winners))
	for p in sorted(winners):
		print(p, end=' ')
	print()


t = int(input())
for k in range(t):
	arraySize = int(input())
	array = [int(s) for s in input().split()]
	pairsArray = [[0, 0]] * arraySize
	for i in range(arraySize):
		pairsArray[i] = [array[i], i]
	pairsArray.sort()
	sumArray = [0] * arraySize
	sumArray[0] = pairsArray[0][0]
	for i in range(1, arraySize):
		sumArray[i] = sumArray[i - 1] + pairsArray[i][0]
	res = [0] * arraySize
	res[arraySize - 1] = 1
	ans = [pairsArray[arraySize - 1][1] + 1]
	for i in range(arraySize - 2, -1, -1):
		if pairsArray[i + 1][0] <= sumArray[i]:
			res[i] = res[i + 1]
			ans.append(pairsArray[i][1] + 1)
		else:
			break
	print(len(ans))
	ans.sort()
	for e in ans:
		print(e, end=' ')
	print()


def works(m, a):
	s = sum(a[0:m + 1])
	for f in a[m + 1:]:
		if s < f:
			return False
		else:
			s += f
	return True
t = int(input())
for _ in range(0, t):
	n = int(input())
	new_a = [(int(x), i) for (i, x) in enumerate(input().split())]
	new_a.sort()
	a = [y[0] for y in new_a]
	(lo, hi) = (0, n)
	while lo + 1 < hi:
		mid = (hi + lo) // 2
		if works(mid, a):
			hi = mid + 1
		else:
			lo = mid + 1
		if lo + 2 == hi:
			if works(lo, a):
				hi = lo + 1
			else:
				lo = lo + 1
	print(len(a) - lo)
	token_list = sorted(list(set((y[1] + 1 for y in new_a[lo:]))))
	print(' '.join(map(str, token_list)))


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = enumerate(a)
	b = sorted(enumerate(a), key=lambda x: x[1])
	if n == 1:
		print(1)
		print(1)
		continue
	s = 0
	tot = [0]
	for j in range(n):
		s += b[j][1]
		tot.append(s)
	ans = []
	for j in range(n - 1, -1, -1):
		if b[j][1] > tot[j]:
			ans.append(b[j][0] + 1)
			break
		else:
			ans.append(b[j][0] + 1)
	ans.sort()
	print(len(ans))
	print(*ans)


t = int(input())

def get_answer(n, a):
	b = [(a[i], i + 1) for i in range(n)]
	b.sort(key=lambda x: x[0])
	s = 0
	i = 0
	t = 0
	while i < n - 1:
		s += b[i][0]
		if s < b[i + 1][0]:
			t = i + 1
		i += 1
	w = b[t:]
	w.sort(key=lambda x: x[1])
	r = ''
	for i in range(len(w)):
		r += str(w[i][1]) + ' '
	print(len(w))
	print(r.strip())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	get_answer(n, a)


import sys
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, sys.stdin.readline().split()))
	sorted_arr = list(sorted(arr))
	smallest = 0
	for i in range(0, n - 1):
		if sorted_arr[i] < sorted_arr[i + 1]:
			smallest = sorted_arr[i + 1]
			sorted_arr[i + 1] += sorted_arr[i]
		else:
			sorted_arr[i + 1] += sorted_arr[i]
			if sorted_arr[i + 1] > sorted_arr[-1]:
				break
	cnt = 0
	lst = []
	for i in range(n):
		if arr[i] >= smallest:
			cnt += 1
			lst.append(i + 1)
	print(cnt)
	print(' '.join(map(str, lst)))


import sys, os, io
input = sys.stdin.readline
from itertools import accumulate
T = int(input())
for t in range(T):
	n = int(input())
	ans = []
	A = list(map(int, input().split()))
	B = [(a, i + 1) for (i, a) in enumerate(A)]
	B.sort()
	A = [a for (a, i) in B]
	cum = list(accumulate(A))
	for (j, (a, i)) in enumerate(B[:-1]):
		ans.append(i)
		if cum[j] < A[j + 1]:
			ans = []
	ans.append(B[-1][1])
	print(len(ans))
	ans.sort()
	print(*ans)


T = int(input())

def do_case(numbers):
	rank = sorted(list(enumerate(numbers)), key=lambda ix: ix[1])
	(poss, vals) = zip(*rank)
	tot = 0
	min_good = 0
	for (i, x) in enumerate(vals):
		if x > tot:
			min_good = i
		tot += x
	winners = sorted(poss[min_good:])
	print(len(winners))
	print(' '.join((str(x + 1) for x in winners)))
for _ in range(T):
	input()
	numbers = list(map(int, input().split()))
	do_case(numbers)


import math
import collections

def read_list() -> list:
	return [int(i) for i in input().strip().split()]

def read_num() -> int:
	return int(input().strip())
t = read_num()
for i in range(t):
	n = read_num()
	arr = read_list()
	idx_tokens = [(i + 1, j) for (i, j) in enumerate(arr)]
	tmp = sorted(idx_tokens, key=lambda x: x[1], reverse=True)
	ans = [tmp[0]]
	s = sum((i[1] for i in idx_tokens))
	for j in range(1, n):
		s -= ans[-1][1]
		if ans[-1][1] <= s or tmp[j][1] == ans[-1][1]:
			ans.append(tmp[j])
		else:
			break
	ans = sorted(ans, key=lambda x: x[0])
	print(len(ans))
	for i in ans:
		print(i[0], end=' ')
	print()


def convertToDic(arr):
	thing = {}
	for x in arr:
		try:
			thing[x] += 1
		except:
			thing[x] = 1
	return thing

def convertDicToProduct(thing):
	dic = {}
	for x in thing:
		dic[x] = thing[x] * x
	return dic

def getResult(dic):
	result = {}
	indicies = getIndicies(dic)
	allFalse = {}
	for x in indicies:
		allFalse[x] = False
	sum = 0
	for x in range(len(dic) - 1):
		sum += dic[indicies[x]]
		if sum < indicies[x + 1]:
			result = allFalse.copy()
		else:
			result[indicies[x]] = True
	result[indicies[len(indicies) - 1]] = True
	return result

def getIndicies(dic):
	indicies = []
	for x in dic:
		indicies.append(x)
	return indicies
for _ in range(int(input())):
	bruh = int(input())
	original = list(map(int, list(input().split(' '))))
	arr = original.copy()
	arr.sort()
	thing = convertToDic(arr)
	dic = convertDicToProduct(thing)
	result = getResult(dic)
	players = 0
	for x in result:
		if result[x]:
			players += thing[x]
	print(players)
	finals = ''
	for x in range(len(original)):
		if result[original[x]]:
			finals += str(x + 1) + ' '
	print(finals)


t = int(input())
for _ in range(t):
	n = int(input())
	nums = list(map(int, input().split()))
	copy_sorted = [(nums[i], i) for i in range(n)]
	copy_sorted.sort()
	prefix = [0] * n
	for i in range(1, n):
		prefix[i] = prefix[i - 1] + copy_sorted[i - 1][0]
	ans = [copy_sorted[n - 1][1] + 1]
	for i in range(n - 2, -1, -1):
		if copy_sorted[i][0] + prefix[i] < copy_sorted[i + 1][0]:
			break
		ans.append(copy_sorted[i][1] + 1)
	ans.sort()
	print(len(ans))
	print(*ans)


t = int(input())
for ti in range(t):
	n = int(input())
	lst = input()
	lst = list(lst.split())
	a = []
	i = 1
	for item in lst:
		a.append([int(item), i])
		i += 1
	if n == 1:
		print(1)
		print(1)
		continue
	a.sort(key=lambda item: item[0])
	ans = [a[len(a) - 1][1]]
	i = len(a) - 2
	while i >= 0:
		if i == 0:
			if a[i][0] == a[i + 1][0]:
				ans.append(a[i][1])
			break
		if a[i][0] == a[i + 1][0]:
			ans.append(a[i][1])
		else:
			j = i - 1
			pot_item = a[i][0]
			while j >= 0 and pot_item < a[i + 1][0]:
				pot_item += a[j][0]
				j -= 1
			if pot_item >= a[i + 1][0]:
				ans.append(a[i][1])
			else:
				break
		i -= 1
	ans.sort()
	print(len(ans))
	print(' '.join([str(elem) for elem in ans]))
	ans = []


import sys, math, itertools
from collections import Counter, deque, defaultdict
from bisect import bisect_left, bisect_right
from heapq import heappop, heappush, heapify, nlargest
from copy import deepcopy
mod = 10 ** 9 + 7
INF = float('inf')

def inp():
	return int(sys.stdin.readline())

def inpl():
	return list(map(int, sys.stdin.readline().split()))

def inpl_1():
	return list(map(lambda x: int(x) - 1, sys.stdin.readline().split()))

def inps():
	return sys.stdin.readline()

def inpsl(x):
	tmp = sys.stdin.readline()
	return tmp[:x]

def err(x):
	print(x)
	exit()
for _ in range(inp()):
	n = inp()
	a = inpl()
	d = defaultdict(list)
	for (i, x) in enumerate(a):
		d[x].append(i)
	sora = sorted(a)
	acc = list(itertools.accumulate(sora))
	ok = []
	for i in range(n)[::-1]:
		if i == n - 1:
			ok.append(sora[i])
		elif acc[i] >= sora[i + 1]:
			ok.append(sora[i])
		else:
			break
	res = []
	for x in list(set(ok)):
		for ind in d[x]:
			res.append(ind + 1)
	print(len(res))
	print(*sorted(res))


import math
from collections import defaultdict

def printans(s, n):
	scopy = s[:]
	s.sort()
	prefixsum = 0
	prefix = [0]
	for i in s:
		prefixsum += i
		prefix.append(prefixsum)
	ans = 0
	for i in range(n - 1):
		if prefix[i + 1] < s[i + 1]:
			ans = s[i + 1]
	ansA = []
	for i in range(n):
		if scopy[i] >= ans:
			ansA.append(i + 1)
	print(len(ansA))
	print(*ansA)
for i in range(int(input())):
	n = int(input())
	s = list(map(int, input().split()))
	printans(s, n)


import os
import sys
from io import BytesIO, IOBase

def func(array):
	indices = sorted(range(len(array)), key=lambda k: array[k])
	sorted_array = [array[index] for index in indices]
	presum = []
	for val in sorted_array:
		if not presum:
			presum.append(val)
		else:
			presum.append(presum[-1] + val)
	chances = []
	for i in range(len(indices) - 1):
		if presum[i] >= sorted_array[i + 1]:
			chances.append(indices[i] + 1)
		else:
			chances = []
	chances.append(indices[-1] + 1)
	return chances

def main():
	num_test = int(parse_input())
	for _ in range(num_test):
		n = int(parse_input())
		array = [int(i) for i in parse_input().split()]
		chances = func(array)
		print(len(chances))
		print(' '.join([str(i) for i in sorted(chances)]))
parse_input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from sys import stdin
T = int(stdin.readline())
while T > 0:
	T -= 1
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	minsum = 0
	lostSet = set()
	newLoser = True
	losers = 0
	aS = sorted(a)
	for i in range(1, len(aS)):
		if aS[i] - aS[i - 1] > 0:
			losers = i
			minsum = aS[i]
		aS[i] += aS[i - 1]
	print(n - losers)
	for i in range(len(a)):
		if a[i] < minsum:
			continue
		print(i + 1, end=' ')
	print()


from collections import defaultdict as dq
for _ in range(int(input())):
	n = int(input())
	li = list(map(int, input().split()))
	d = dq(list)
	for i in range(n):
		d[li[i]].append(i + 1)
	li.sort()
	li1 = [0] * n
	s = 0
	for i in range(n):
		s += li[i]
		li1[i] = s
	li2 = []
	li2.append(d[li[-1]][0])
	d[li[i]].remove(d[li[-1]][0])
	for i in range(n - 2, -1, -1):
		if li1[i] >= li[i + 1]:
			li2.append(d[li[i]][0])
			d[li[i]].remove(d[li[i]][0])
		else:
			break
	print(len(li2))
	li2.sort()
	print(*li2)


T = int(input())
for case in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	arr = []
	for i in range(n):
		arr.append((a[i], i + 1))
	arr.sort()
	presum = []
	presum.append(arr[0][0])
	for i in range(1, n):
		presum.append(presum[-1] + arr[i][0])
	ans = [arr[n - 1][1]]
	for i in range(n - 2, -1, -1):
		if presum[i] >= arr[i + 1][0]:
			ans.append(arr[i][1])
		else:
			break
	print(len(ans))
	ans.sort()
	print(*ans)


for s in [*open(0)][2::2]:
	S = 0
	z = []
	for (x, i) in sorted(((x, i + 1) for (i, x) in enumerate(map(int, s.split())))):
		if S < x:
			z = []
		S += x
		z += [i]
	print(len(z), '\n', *sorted(z))


from collections import Counter
import math
for _ in range(int(input())):
	n = int(input())
	lt = list(map(int, input().split()))
	l1 = [1] * n
	l = lt.copy()
	l.sort()
	s = l[0]
	d = {}
	for i in range(1, n):
		if s < l[i]:
			l1[i - 1] = 0
		s += l[i]
	ind = -1
	for i in range(n - 1, -1, -1):
		if l1[i] == 0:
			ind = i
			break
	if ind != -1:
		for i in range(ind + 1):
			l1[i] = 0
			d[l[i]] = 1
	cnt = 0
	ans = []
	for i in range(n):
		if lt[i] not in d:
			cnt += 1
			ans.append(i + 1)
	print(cnt)
	print(*ans)


def answer():
	(ind, val) = (0, all[0][0])
	for i in range(1, n):
		if all[i][0] > val:
			ind = i
		val += all[i][0]
	winners = []
	for i in range(ind, n):
		winners.append(all[i][1] + 1)
	print(len(winners))
	print(*sorted(winners))
for T in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	all = [[a[i], i] for i in range(n)]
	all.sort(key=lambda x: x[0])
	answer()


import sys
import math

def input():
	return sys.stdin.readline().strip('\n')

def I():
	return input()

def II():
	return int(input())

def MI():
	return map(int, input().split())

def LI():
	return list(map(int, input().split()))
for _ in range(II()):
	n = II()
	a = LI()
	v = []
	for (i, j) in enumerate(a):
		v.append((j, i))
	v.sort()
	pref = [0] * n
	pref[0] = v[0][0]
	for i in range(1, n):
		pref[i] = pref[i - 1] + v[i][0]
	ans = []
	ans.append(v[n - 1][1] + 1)
	vis = [0] * n
	vis[n - 1] = 1
	for i in range(n - 2, -1, -1):
		if pref[i] >= v[i + 1][0] and vis[i + 1]:
			ans.append(v[i][1] + 1)
			vis[i] = True
	ans.sort()
	print(len(ans))
	print(*ans)


for _ in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	b = a.copy()
	b.sort()
	fits = 0
	previous_tokens = 0
	for ind in range(n - 1):
		if b[ind] + previous_tokens < b[ind + 1]:
			fits = ind + 1
		previous_tokens += b[ind]
	suitable_tokens = set()
	for ind in range(fits, n):
		suitable_tokens.add(b[ind])
	num_of_players = 0
	indices_of_players = []
	for (ind, a_i) in enumerate(a):
		if a_i in suitable_tokens:
			num_of_players += 1
			indices_of_players.append(ind + 1)
	print(num_of_players)
	print(*indices_of_players)


for _ in range(int(input())):
	n = int(input())
	a = [(k + 1, i) for (k, i) in enumerate(map(int, input().split()))]
	a.sort(key=lambda x: x[1])
	(aft, cnt, lelem) = (-1, 0, a[-1][1])
	for (k, (__, v)) in enumerate(a):
		cnt += v
		if cnt >= lelem or cnt >= a[k + 1][1]:
			continue
		aft = k
	print(n - (aft + 1))
	b = sorted([k for (k, v) in a[aft + 1:]])
	for i in b:
		print(i, end=' ')
	print()


from collections import defaultdict, OrderedDict, Counter
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
from queue import Queue, PriorityQueue
from heapq import heapify, heappop, heappush
from statistics import median, mean
from math import gcd, sqrt, floor, factorial, ceil, log2, log10, log
import fractions
import copy
from copy import deepcopy
import sys
import io
sys.setrecursionlimit(10 ** 8)
import math
import os
import bisect
import collections
mod = pow(10, 9) + 7
import random
from random import random, randint, randrange
from time import time

def ncr(n, r, p=mod):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def normalncr(n, r):
	r = min(r, n - r)
	count = 1
	for i in range(n - r, n + 1):
		count *= i
	for i in range(1, r + 1):
		count //= i
	return count
inf = float('inf')
adj = defaultdict(set)
visited = defaultdict(int)

def addedge(a, b):
	adj[a].add(b)
	adj[b].add(a)

def bfs(v):
	q = Queue()
	q.put(v)
	visited[v] = 1
	while q.qsize() > 0:
		s = q.get_nowait()
		print(s)
		for i in adj[s]:
			if visited[i] == 0:
				q.put(i)
				visited[i] = 1

def dfs(v, visited):
	if visited[v] == 1:
		return
	visited[v] = 1
	print(v)
	for i in adj[v]:
		dfs(i, visited)

def reverse_bisect_right(a, x, lo=0, hi=None):
	if lo < 0:
		raise ValueError('lo must be non-negative')
	if hi is None:
		hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if x > a[mid]:
			hi = mid
		else:
			lo = mid + 1
	return lo

def reverse_bisect_left(a, x, lo=0, hi=None):
	if lo < 0:
		raise ValueError('lo must be non-negative')
	if hi is None:
		hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if x >= a[mid]:
			hi = mid
		else:
			lo = mid + 1
	return lo

def get_list():
	return list(map(int, input().split()))

def get_str_list_in_int():
	return [int(i) for i in list(input())]

def get_str_list():
	return list(input())

def get_map():
	return map(int, input().split())

def input_int():
	return int(input())

def matrix(a, b):
	return [[0 for i in range(b)] for j in range(a)]

def swap(a, b):
	return (b, a)

def find_gcd(l):
	a = l[0]
	for i in range(len(l)):
		a = gcd(a, l[i])
	return a

def is_prime(n):
	sqrta = int(sqrt(n))
	for i in range(2, sqrta + 1):
		if n % i == 0:
			return 0
	return 1

def prime_factors(n):
	sqrta = int(sqrt(n))
	for i in range(2, sqrta + 1):
		if n % i == 0:
			return [i] + prime_factors(n // i)
	return [n]

def p(a):
	if type(a) == str:
		print(a + '\n')
	else:
		print(str(a) + '\n')

def ps(a):
	if type(a) == str:
		print(a)
	else:
		print(str(a))

def kth_no_not_div_by_n(n, k):
	return k + (k - 1) // (n - 1)
nc = 'NO'
yc = 'YES'
ns = 'No'
ys = 'Yes'

def get_value(m, index):
	if 0 <= index < len(m):
		return m[index]
	return 0
t = int(input())
for i in range(t):
	n = int(input())
	l = get_list()
	suma = sum(l)
	l = [[l[i], i + 1] for i in range(n)]
	l.sort()
	dict = defaultdict(int)
	dict[l[-1][1]] = 1
	for i in reversed(range(n)):
		suma -= l[i][0]
		if suma >= l[i][0]:
			dict[l[i - 1][1]] = 1
		else:
			break
	gamma = sorted(list(dict))
	print(len(gamma))
	print(*gamma)


for u in range(int(input())):
	n = int(input())
	l = [int(w) for w in input().split()]
	l = [[l[i], i + 1] for i in range(n)]
	l.sort(key=lambda x: x[0])
	s = l[0][0]
	x = l[-1][0]
	p = 0
	for i in range(1, n):
		if l[i][0] > s:
			p = i
			s = s + l[i][0]
			continue
		s += l[i][0]
	ans = []
	t = 0
	for i in range(p, n):
		ans.append(l[i][1])
		t += 1
	print(t)
	print(*sorted(ans))


def solve(A, n):
	if n == 1:
		return [1]
	l_aux = sorted(A)
	index = 0
	s = l_aux[0]
	for i in range(1, n):
		if s < l_aux[i]:
			index = i
		s += l_aux[i]
	m_value = l_aux[index]
	result = []
	for i in range(n):
		if l[i] >= m_value:
			result.append(i + 1)
	return result
for test in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	result = solve(l, n)
	print(len(result))
	print(*result)


import math
T = int(input())
for testcase in range(1, T + 1):
	n = int(input())
	l = input().split(' ')
	a = [int(i) for i in l]
	temp = sorted(enumerate(a), key=lambda x: x[1])
	a = [i[1] for i in temp]
	index = [i[0] for i in temp]
	s = [0] * n
	weakestwinner = 0
	s[0] = a[0]
	for i in range(n - 1):
		if s[i] < a[i + 1]:
			weakestwinner = i + 1
		s[i + 1] = s[i] + a[i + 1]
	print(n - weakestwinner)
	wwstrengh = a[weakestwinner]
	res = []
	for i in range(n):
		if a[i] >= wwstrengh:
			res.append(index[i] + 1)
	res.sort()
	string = ''
	for i in res:
		string += str(i) + ' '
	print(string)


def sol(n, l):
	ll = []
	for (k, v) in enumerate(l):
		ll.append((v, k))
	ll.sort(key=lambda x: x[0])
	ts = sum(l) - ll[-1][0]
	ans = [ll[-1][1] + 1]
	for i in range(n - 2, -1, -1):
		if ts >= ll[i + 1][0]:
			ts -= ll[i][0]
			ans.append(ll[i][1] + 1)
		else:
			break
	return sorted(ans)
t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	fa = sol(n, l)
	print(len(fa))
	print(*fa)


import math, sys
from collections import defaultdict, Counter, deque
from bisect import bisect_left, bisect_right
INF = float('inf')
MOD = int(1000000000.0) + 7
MAX = int(1000000.0) + 1

def solve():
	n = int(input())
	arr = array()
	for i in range(n):
		arr[i] = [arr[i], i + 1]
	arr = sorted(arr)
	ans = []
	pre = 0
	for i in range(n - 1):
		pre += arr[i][0]
		ans.append(arr[i][1])
		if pre < arr[i + 1][0]:
			ans = []
	ans.append(arr[n - 1][1])
	print(len(ans))
	print(*sorted(ans))

def main():
	t = 1
	t = int(input())
	for _ in range(t):
		solve()

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def input():
	return sys.stdin.readline().rstrip('\n').strip()

def print(*args, sep=' ', end='\n'):
	first = True
	for arg in args:
		if not first:
			sys.stdout.write(sep)
		sys.stdout.write(str(arg))
		first = False
	sys.stdout.write(end)
primes = [1 for i in range(MAX)]

def sieve():
	global primes
	primes[0] = primes[1] = 0
	i = 2
	while i <= MAX ** 0.5:
		j = i * i
		while primes[i] and j < MAX:
			if j % i == 0:
				primes[j] = 0
			j += i
		i += 1

def vars():
	return map(int, input().split())

def array():
	return list(map(int, input().split()))
main()


from bisect import bisect_left, bisect_right
for test in range(int(input())):
	n = int(input())
	lst = list(map(int, input().strip().split()))
	arr = sorted(lst)
	sum_lst = [0] * n
	s = 0
	for i in range(n):
		s += arr[i]
		sum_lst[i] = s
	winner = set({})
	for i in range(n - 1):
		if sum_lst[i] >= arr[i + 1]:
			winner.add(arr[i])
		else:
			winner.clear()
	winner.add(arr[-1])
	ans = set({})
	for i in range(n):
		if lst[i] in winner:
			ans.add(i + 1)
	print(len(ans))
	print(*ans)


t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	ar = [int(x) for x in input().split()]
	a = ar.copy()
	a.sort()
	s = []
	p = a[0]
	k = 0
	for i in range(1, n):
		if p < a[i]:
			k = i
		p = p + a[i]
	for i in range(0, n):
		if a[k] <= ar[i]:
			s.append(i + 1)
	print(len(s))
	print(*s)


import sys
from collections import defaultdict as dd
from collections import Counter as cc
from queue import Queue
import math
from math import sqrt
import itertools
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
input = lambda : sys.stdin.readline().rstrip()
for _ in range(int(input())):
	q = int(input())
	w = list(map(int, input().split()))
	e = dd(list)
	for i in range(q):
		e[w[i]].append(i + 1)
	w = sorted(w)
	a = []
	r = w[0]
	t = 0
	for i in range(1, q):
		if r == w[i]:
			a.append(e[w[i - 1]].pop())
			t = 1
		elif r > w[i]:
			if t == 1:
				t = 0
			a.append(e[w[i - 1]].pop())
		else:
			if t == 1:
				t = 0
			a = []
		r += w[i]
	a.append(e[w[-1]].pop())
	print(len(a))
	print(*sorted(a))


import sys

def read_int():
	return int(sys.stdin.readline().strip())

def read_ints():
	return list(map(int, sys.stdin.readline().split()))
for _ in '.' * read_int():
	n = read_int()
	a = read_ints()
	req = 0
	b = sorted(a)
	if n == 1:
		print('1\n1')
		continue
	s = [b[0]]
	for i in range(1, n):
		s.append(b[i] + s[i - 1])
	if s[-2] < b[-1]:
		print('1')
		print(a.index(b[-1]) + 1)
		continue
	for j in range(n - 1):
		if s[j] < b[j + 1]:
			continue
		for x in range(j + 1, n - 1):
			if s[x] < b[x + 1]:
				break
		else:
			req = b[j]
			break
	print(n - j)
	for p in range(n):
		if a[p] >= req:
			print(p + 1, end=' ')
	print()


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	ar = list(map(int, input().split()))
	li = []
	for i in range(n):
		li.append([ar[i], i])
	li.sort(key=lambda x: x[0])
	br = [li[0][0]]
	for i in range(1, n):
		br.append(br[-1] + li[i][0])
	ans = [li[-1][1] + 1]
	for i in range(n - 2, -1, -1):
		if br[i] < li[i + 1][0]:
			break
		else:
			ans.append(li[i][1] + 1)
	ans.sort()
	print(len(ans))
	print(*ans)


import sys
import os.path
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
depth = 1000005
mod = 1000000007
sys.setrecursionlimit(depth)
from math import inf, ceil
from collections import defaultdict
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	d = list(([a[i], i + 1] for i in range(n)))
	d.sort(key=lambda x: x[0])
	v = [d[i][0] for i in range(n)]
	for i in range(1, n):
		v[i] += v[i - 1]
	res = [d[-1][1]]
	i = n - 1
	while d[i][0] <= v[i - 1] and i > 0:
		res.append(d[i - 1][1])
		i -= 1
	siz = len(res)
	res = sorted(res)
	print(siz)
	print(*res)


import math
import sys

class IO:

	@staticmethod
	def string():
		return input()

	@staticmethod
	def int():
		return int(input())

	@staticmethod
	def list(sep=' '):
		return input().split(sep)

	@staticmethod
	def list_int(sep=' '):
		return list(map(int, input().split(sep)))

	@staticmethod
	def implode(sep, array):
		return sep.join((str(x) for x in array))
ans = {}

def solve():
	n = IO.int()
	a = IO.list_int()
	b = a[:]
	res = {}
	a.sort()
	maxN = 0
	for i in range(n - 1):
		if a[i] + maxN < a[i + 1]:
			res = {}
		else:
			res[a[i]] = 1
		maxN += a[i]
	res[a[n - 1]] = 1
	res1 = []
	for i in range(n):
		if b[i] in res:
			res1.append(str(i + 1))
	print(len(res1))
	print(' '.join(res1))
query_count = IO.int()
while query_count:
	query_count -= 1
	solve()


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def inp():
	return sys.stdin.readline().rstrip()

def mpint():
	return map(int, inp().split(' '))

def itg():
	return int(inp())
from itertools import accumulate

class PrefixArray:

	def __init__(self, seq):
		self.data = tuple(seq)
		self.prefix = tuple(accumulate(self.data))

	def __getitem__(self, item) -> int:
		if type(item) is int:
			return self.prefix[item]
		start = 0 if item.start is None else item.start % len(self)
		stop = len(self) if item.stop is None else (item.stop - 1) % len(self) + 1
		if stop == 0:
			return 0
		if start == 0:
			return self.prefix[stop - 1]
		return self.prefix[stop - 1] - self.prefix[start - 1]

	def __len__(self):
		return len(self.data)
from bisect import bisect_right

def solve():
	n = itg()
	arr = tuple(mpint())
	nums = sorted(arr)
	s = sum(nums)
	pa = PrefixArray(nums)
	mn = nums[-1]
	ans = []
	for (i, v) in enumerate(arr):
		if v >= mn:
			ans.append(i)
			continue
		tmp = v
		prev = lo = 0
		while v != prev:
			prev = v
			lo = bisect_right(nums, v, lo)
			v = pa[:lo]
		if v == s:
			ans.append(i)
			mn = min(mn, tmp)
	print(len(ans))
	return sorted([a + 1 for a in ans])

def main():
	for _ in range(itg()):
		print(*solve())
DEBUG = 0
URL = 'https://codeforces.com/contest/1490/problem/E'
if DEBUG == 1:
	import requests
	from ACgenerator.Y_Test_Case_Runner import TestCaseRunner
	runner = TestCaseRunner(main, URL)
	inp = runner.input_stream
	print = runner.output_stream
	runner.checking()
else:
	if DEBUG != 3:
		(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
	if DEBUG:
		_print = print

		def print(*args, **kwargs):
			_print(*args, **kwargs)
			sys.stdout.flush()
	main()


import io
import os
import math
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
t = int(input())
for _ in range(t):
	n = int(input())
	d = {}
	a = [int(x) for x in input().split()]
	for i in range(n):
		if a[i] not in d:
			d[a[i]] = []
		d[a[i]].append(i + 1)
	a.sort()
	b = [0] * n
	temp = 0
	for i in range(n):
		b[i] = temp
		temp += a[i]
	i = n - 1
	while b[i] >= a[i]:
		i -= 1
	tt = a[i]
	ans = []
	for x in d:
		if x >= tt:
			ans += d[x]
	print(len(ans))
	ans.sort()
	print(*ans)


import math
t = int(input())
for i in range(0, t):
	n = int(input())
	l = list(map(int, input().split()))
	s = 0
	l2 = []
	for j in range(0, n):
		l3 = []
		l3.append(l[j])
		l3.append(j + 1)
		l2.append(l3)
	l1 = []
	l2.sort()
	l.sort()
	for j in l:
		s += j
		l1.append(s)
	c = 1
	l3 = []
	l3.append(l2[n - 1][1])
	for j in range(n - 2, -1, -1):
		if l1[j] >= l[j + 1]:
			c += 1
			l3.append(l2[j][1])
		else:
			break
	print(c)
	l3.sort()
	print(*l3)


import sys
input = sys.stdin.readline
from itertools import accumulate

def read():
	N = int(input().strip())
	A = list(map(int, input().strip().split()))
	return (N, A)

def argsort(seq):
	return sorted(range(len(seq)), key=seq.__getitem__)

def solve(N, A):
	players = argsort(A)
	B = [a for a in sorted(A)]
	S = list(accumulate(B))
	ans = [players[-1] + 1]
	lose = False
	for i in range(N - 2, -1, -1):
		if not lose and S[i] >= B[i + 1]:
			ans.append(players[i] + 1)
		else:
			lose = True
	ans.sort()
	print(len(ans))
	print(*ans)
T = int(input().strip())
for t in range(T):
	inputs = read()
	solve(*inputs)


for _ in range(int(input())):
	n = int(input())
	arr = [int(x) for x in input().split()]
	array = sorted(arr, reverse=True)
	sm = sum(arr)
	k = 0
	for element in array:
		sm -= element
		k += 1
		if sm < element:
			break
	print(k)
	j = 1
	myarray = []
	for ele in arr:
		if ele >= element:
			myarray.append(str(j))
		j += 1
	print(' '.join(myarray))


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	get = list(map(int, input().split()))
	tokens = [(get[i], i) for i in range(n)]
	srt = sorted(tokens)
	i = 0
	x = 0
	front = 0
	while i < n:
		num = srt[i][0]
		howmany = 1
		for k in range(i + 1, n):
			if num == srt[k][0]:
				howmany += 1
			else:
				break
		if i + howmany < n and front + num * howmany < srt[i + howmany][0]:
			x = srt[i][0]
		front += num * howmany
		i += howmany
	ans = []
	for i in range(n):
		if tokens[i][0] > x:
			ans.append(tokens[i][1] + 1)
	print(len(ans))
	print(' '.join((str(i) for i in ans)))


t = int(input())
ans = []
for _ in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	b = []
	for i in range(n):
		b.append((a[i], i + 1))
	b.sort(reverse=True)
	c = []
	s = sum(a)
	c.append(b[0][1])
	s -= b[0][0]
	for i in range(1, n):
		if s < b[i - 1][0]:
			ans.append(sorted(c))
			break
		c.append(b[i][1])
		s -= b[i][0]
	else:
		ans.append(sorted(c))
for i in ans:
	print(len(i))
	print(*i)


from collections import defaultdict

def solve(n, arr):
	pos = defaultdict(list)
	for (index, val) in enumerate(arr):
		pos[val].append(index + 1)
	arr = sorted(arr)
	prefix = [arr[0]]
	for i in range(1, n):
		prefix.append(arr[i] + prefix[i - 1])
	for index in range(n - 2, -1, -1):
		if arr[index + 1] > prefix[index]:
			ans = []
			for item in arr[index + 1:]:
				ans.append(pos[item].pop())
			return sorted(ans)
	return list(range(1, n + 1))
t = int(input())
for case in range(t):
	n = int(input())
	arr = list(map(int, input().split(' ')))
	result = solve(n, arr)
	print(len(result))
	print(' '.join(list(map(str, result))))


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	d = {}
	d1 = {}
	arr1 = []
	for i in range(n):
		d[arr[i]] = d.get(arr[i], 0) + 1
	for i in d:
		arr1.append([d[i], i])
	arr1 = sorted(arr1, key=lambda x: x[1])
	summ = sum(arr)
	maxx = max(arr)
	d1 = {}
	ans = []
	for i in range(len(arr1) - 1, -1, -1):
		if summ >= maxx:
			summ -= arr1[i][0] * arr1[i][1]
			maxx = arr1[i][1]
			d1[arr1[i][1]] = 1
		else:
			break
	for i in range(n):
		if d1.get(arr[i], 0) > 0:
			ans.append(i + 1)
	print(len(ans))
	print(*ans)


def solve(arr):
	arr.sort()
	s = 0
	sum_arr = []
	for i in range(len(arr)):
		s += arr[i]
		sum_arr.append(s)
	ans = 0
	for i in range(len(arr) - 2, -1, -1):
		if sum_arr[i] >= arr[i + 1]:
			ans = arr[i]
		else:
			break
	if ans:
		return ans
	else:
		return arr[-1]
t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	ans = []
	ans_temp = solve(arr.copy())
	for i in range(len(arr)):
		if arr[i] >= ans_temp:
			ans.append(i + 1)
	print(len(ans))
	print(' '.join([str(num) for num in sorted(ans)]))


import math
from collections import defaultdict
DEBUG = True

def log(*args, **kwargs):
	if DEBUG:
		print(*args, **kwargs)

def rint():
	return int(input())

def rlist(f=int):
	return list(map(f, input().split()))

def rstr():
	return input()

class Solution:

	def __init__(self):
		self.result = []
		self.a = []

	def run(self):
		n = rint()
		a = rlist()
		tokens = defaultdict(list)
		for i in range(n):
			tokens[a[i]].append(i)
		possible = []
		current = 0
		s = sorted(tokens.keys())
		for i in range(len(s)):
			if i == len(s) - 1:
				possible.extend(tokens[s[i]])
				continue
			if current + s[i] * len(tokens[s[i]]) < s[i + 1]:
				possible = []
			else:
				possible.extend(tokens[s[i]])
			current += s[i] * len(tokens[s[i]])
		print(len(possible))
		return ' '.join([str(x + 1) for x in sorted(possible)])
t = int(input())
s = Solution()
for i in range(t):
	print(s.run())


for _ in range(int(input())):
	n = int(input())
	a = [[int(el), i + 1] for (i, el) in enumerate(input().split())]
	a.sort(key=lambda x: x[0])
	suma = 0
	for i in range(n - 1):
		suma += a[i][0]
	ans = [a[-1][1]]
	ansl = 1
	for i in range(n - 2, -1, -1):
		if suma >= a[i + 1][0]:
			ans.append(a[i][1])
			ansl += 1
			suma -= a[i][0]
		else:
			break
	ans.sort()
	print(ansl)
	print(*ans)


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	nums = list(map(int, sys.stdin.readline().split()))
	per = []
	for i in range(n):
		per.append((i, nums[i]))
	per.sort(key=lambda x: x[1])
	answer = [n]
	i = 0
	su = 0
	k = 0
	while i < n - 1:
		su += per[i][1]
		if su >= per[i + 1][1]:
			k += 1
		else:
			k = 0
		i += 1
	k += 1
	answer = per[n - k:]
	ks = []
	for i in answer:
		ks.append(i[0] + 1)
	ks.sort()
	ks = list(map(str, ks))
	print(k)
	print(' '.join(ks))


import io
import os
from collections import Counter, defaultdict, deque

def solve(N, A):
	indices = list(range(N))
	indices.sort(key=lambda i: A[i])
	sA = []
	for i in indices:
		sA.append(A[i])
	pref = [0]
	for x in sA:
		pref.append(pref[-1] + x)
	for i in reversed(range(N)):
		assert A[indices[i]] == sA[i]
		if pref[i] < A[indices[i]]:
			players = indices[i:]
			break
	return str(len(players)) + '\n' + ' '.join((str(i + 1) for i in sorted(players)))
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
TC = int(input())
for tc in range(1, TC + 1):
	(N,) = [int(x) for x in input().split()]
	A = [int(x) for x in input().split()]
	ans = solve(N, A)
	print(ans)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	for i in range(n):
		a[i] = (a[i], i)
	a.sort()
	(l, r) = (-1, n - 1)
	while r - l > 1:
		m = (l + r) // 2
		t = 0
		for i in range(m + 1):
			t += a[i][0]
		for i in range(m + 1, n):
			if t < a[i][0]:
				l = m
				break
			t += a[i][0]
		else:
			r = m
	res = []
	for i in range(r, n):
		res.append(a[i][1] + 1)
	res.sort()
	print(len(res))
	print(*res)


for _ in range(int(input())):
	n = int(input())
	a = list(enumerate(map(int, input().split())))
	a.sort(key=lambda x: x[1])
	p = [a[0][1]]
	for i in range(1, n):
		p.append(p[i - 1] + a[i][1])
	ans = []
	a.append([0, 0])
	l = -1
	for i in range(n):
		if p[i] < a[i + 1][1]:
			l = i
	for i in range(l + 1, n):
		ans.append(a[i][0] + 1)
	print(len(ans))
	print(*sorted(ans))


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
from decimal import *
from collections import deque
BUFSIZE = 8192
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		a = list(map(int, input().split()))
		if n == 1:
			print(1)
			print(1)
			continue
		sa = sorted([[i + 1, a[i]] for i in range(n)], key=lambda x: (x[1], x[0]))
		ans = []
		prefix = sa[0][1]
		for j in range(1, n):
			index = sa[j - 1][0]
			v = sa[j][1]
			if prefix >= v:
				ans.append(index)
			else:
				ans.clear()
			prefix += v
		ans.append(sa[-1][0])
		ans.sort()
		print(len(ans))
		print(' '.join([str(x) for x in ans]))
main()


for _ in range(int(input())):
	n = int(input())
	l1 = [int(__) for __ in input().split()]
	l2 = []
	for i in range(n):
		l2.append([i + 1, l1[i], 0])
	l1.sort()
	l2.sort(key=lambda x: x[1])
	for i in range(1, n):
		l2[i][1] += l2[i - 1][1]
	for i in range(n - 1):
		if l2[i][1] >= l1[i + 1]:
			l2[i][2] = 1
	l2[-1][2] = 1
	ans = []
	for i in l2[::-1]:
		if i[2] == 1:
			ans.append(i[0])
		else:
			break
	print(len(ans))
	for i in sorted(ans):
		print(i, end=' ')
	print('')


t = int(input())
for q in range(t):
	n = int(input())
	arr = [int(x) for x in input().split()]
	enum = list(enumerate(arr))
	enum.sort(key=lambda inner: inner[1])
	lis = [enum[0][1]]
	for i in range(1, n):
		lis.append(lis[i - 1] + enum[i][1])
	ind = None
	for i in range(1, n):
		if enum[i][1] > lis[i - 1]:
			ind = i - 1
	if ind == None:
		res = [i for i in range(1, n + 1)]
		print(n)
		print(*res)
		continue
	ans = []
	for i in range(ind + 1, n):
		ans.append(enum[i][0] + 1)
	ans.sort()
	print(len(ans))
	print(*ans)


import sys
import math
from sys import stdin, stdout

def sieve(N):
	primeNumbers = [True] * (N + 1)
	primeNumbers[0] = False
	primeNumbers[1] = False
	i = 2
	while i * i <= N:
		j = i
		if primeNumbers[j]:
			while j * i <= N:
				primeNumbers[j * i] = False
				j += 1
		i += 1
	return primeNumbers

def getPrime(N):
	primes = sieve(N)
	result = []
	for i in range(len(primes)):
		if primes[i]:
			result.append(i)
	return result

def factor(N):
	factors = []
	i = 1
	while i * i <= N:
		if N % i == 0:
			factors.append(i)
			if i != N // i:
				factors.append(N // i)
		i += 1
	return sorted(factors)

def gcd(a, b):
	if a < b:
		return gcd(b, a)
	if b == 0:
		return a
	return gcd(b, a % b)

def extendedGcd(a, b):
	if a < b:
		return extendedGcd(b, a)
	if b == 0:
		return [a, 1, 0]
	res = extendedGcd(b, a % b)
	x = res[2]
	y = res[1] - math.floor(a / b) * res[2]
	res[1] = x
	res[2] = y
	return res

def iterativeModularFunc(a, b, c):
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % c
		a = a * a % c
		b = b // 2
	return res

def get_ints_in_variables():
	return map(int, sys.stdin.readline().strip().split())

def get_int():
	return int(input())

def get_ints_in_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_list_of_list(n):
	return [list(map(int, sys.stdin.readline().strip().split())) for _ in range(n)]

def get_string():
	return sys.stdin.readline().strip()

def canWin(arr, prefix, n, mid):
	s = prefix[mid + 1]
	for i in range(mid + 1, n):
		if s >= arr[i][0]:
			s += arr[i][0]
		else:
			break
	if s >= prefix[-1]:
		return True
	else:
		return False

def Solution(arr, n):
	l = 0
	r = n - 1
	a = sorted([[arr[i], i + 1] for i in range(n)], key=lambda x: x[0])
	prefix = [0]
	for v in a:
		prefix.append(prefix[-1] + v[0])
	ans = -1
	while l <= r:
		mid = (l + r) // 2
		if canWin(a, prefix, n, mid):
			ans = mid
			r = mid - 1
		else:
			l = mid + 1
	if ans == -1:
		print(n)
		for v in range(1, n + 1):
			print(v, end=' ')
		print()
		return
	else:
		print(n - ans)
		res = []
		for v in range(ans, n):
			res.append(a[v][1])
		res = sorted(res)
		for v in res:
			print(v, end=' ')
		print()

def main():
	for _ in range(get_int()):
		n = get_int()
		arr = get_ints_in_list()
		Solution(arr, n)
main()


t = int(input())
for i in range(t):
	n = int(input())
	l1 = list(map(int, input().split()))
	l2 = l1[:]
	l2.sort()
	mx = l2[n - 1]
	k = l2[0]
	sum1 = k
	for j in range(1, n):
		if sum1 >= l2[j]:
			sum1 = sum1 + l2[j]
		else:
			k = l2[j]
			sum1 = sum1 + l2[j]
		if sum1 >= mx:
			break
	l3 = []
	for j in range(0, n):
		if l1[j] >= k:
			l3.append(j + 1)
	l = len(l3)
	print(l)
	for j in range(0, l):
		print(l3[j], end=' ')
	print()


import sys
input = sys.stdin.readline

def solution(n, arr_orig):
	right_ = -1
	partials_sums = []
	arr = arr_orig[:]
	arr.sort()
	partials_sums = [arr[0]]
	for elem in arr[1:]:
		partials_sums.append(partials_sums[-1] + elem)
	for pos in range(n - 2, -1, -1):
		if partials_sums[pos] * 2 < partials_sums[pos + 1]:
			right = pos + 1
			print(n - right)
			low_bound = arr[right]
			print(*[i + 1 for i in range(n) if arr_orig[i] >= low_bound])
			return
	print(n)
	print(*[i for i in range(1, n + 1)])
T = int(input())
for t in range(T):
	n = int(input())
	arr_orig = list(map(int, input().split()))
	solution(n, arr_orig)


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	arr = list(map(int, stdin.readline().split()))
	a = sorted(arr)
	check = []
	ans = []
	s = sum(a)
	c = 0
	m = a[-1]
	for (j, v) in enumerate(a[::-1]):
		if s >= m:
			c += 1
			s -= v
			m = v
			check.append(v)
		else:
			break
	for i in range(n):
		if arr[i] in check:
			ans.append(i + 1)
	stdout.write(str(c) + '\n')
	stdout.write(' '.join(map(str, ans)) + '\n')


from itertools import accumulate

def solve():
	n = int(input())
	l = list(map(int, input().split()))
	l = sorted([(l[i], i) for i in range(n)])
	a = [l[i][0] for i in range(n)]
	idx = [l[i][1] + 1 for i in range(n)]
	ps = list(accumulate(a))
	sol = [idx[-1]]
	i = n - 2
	while i >= 0 and ps[i] >= a[i + 1]:
		sol.append(idx[i])
		i -= 1
	sol.sort()
	print(len(sol))
	print(' '.join(map(str, sol)))
t = int(input())
for _ in range(t):
	solve()


from collections import defaultdict
t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = a[:]
	b.sort()
	re = -1
	p = 0
	for j in range(n - 1):
		p = p + b[j]
		if p < b[j + 1]:
			re = j
	res = [1] * n
	if re != -1:
		d = defaultdict(list)
		q = dict()
		for j in range(n):
			d[a[j]].append(j)
			if a[j] in q:
				q[a[j]] + 1
			else:
				q[a[j]] = 1
		for j in range(re + 1):
			p = d[b[j]][q[b[j]] - 1]
			q[b[j]] -= 1
			res[p] = 0
	ans = []
	m = 0
	for j in range(n):
		if res[j] == 1:
			m += 1
			ans.append(j + 1)
	print(m)
	print(' '.join(map(str, ans)))


test_cases = int(input())
for test in range(test_cases):
	num_of_players = int(input())
	power_level = list(map(int, input().split(' ')))
	players = [i for i in range(num_of_players)]
	players_ascending_power = sorted(players, key=lambda player_id: power_level[player_id])
	strongest_player = players_ascending_power[-1]
	highest_power = power_level[strongest_player]
	accumulated_power = power_level[players_ascending_power[0]]
	streak_start = 0
	streak_size = 1
	for i in range(1, num_of_players):
		next_opponent = players_ascending_power[i]
		difficulty = power_level[next_opponent]
		if accumulated_power >= difficulty:
			streak_size += 1
		else:
			streak_start = i
			streak_size = 1
		accumulated_power += difficulty
	possible_winners = sorted([players_ascending_power[i] + 1 for i in range(streak_start, streak_start + streak_size)])
	print(len(possible_winners))
	print(' '.join(list(map(str, possible_winners))))


for i in range(int(input())):
	n = int(input())
	ar = list(map(int, input().split()))
	a = ar.copy()
	a.sort()
	s = []
	p = a[0]
	k = 0
	for i in range(1, n):
		if p < a[i]:
			k = i
		p = p + a[i]
	for i in range(0, n):
		if a[k] <= ar[i]:
			s.append(i + 1)
	print(len(s))
	print(*s)


for _ in range(int(input())):
	n = int(input())
	numbers = list(map(int, input().split()))
	sorted_num = sorted(numbers)
	summ = sum(numbers)
	for i in range(n - 1, -1, -1):
		summ -= sorted_num[i]
		if summ < sorted_num[i]:
			predel = sorted_num[i]
			break
	answer = []
	for i in range(n):
		if numbers[i] >= predel:
			answer.append(i + 1)
	print(len(answer))
	print(*sorted(answer))


for _ in range(int(input())):
	n = int(input())
	A = list(map(int, input().split()))
	x = [0] * n
	for i in range(n):
		x[i] = A[i]
	A.sort(reverse=True)
	l = 0
	r = n - 1
	B = [0] * n
	B[n - 1] = A[n - 1]
	for i in range(n - 2, -1, -1):
		B[i] = B[i + 1] + A[i]
	ans = []
	s = 10 ** 9
	for __ in range(30):
		m = (l + r) // 2
		z = B[m]
		fl = 1
		for i in range(m - 1, -1, -1):
			if z >= A[i]:
				z += A[i]
				fl = 1
			else:
				fl = 0
				break
		if fl == 1:
			s = min(s, A[m])
			l = m
		else:
			r = m
	for i in range(n):
		if x[i] >= s:
			ans.append(i + 1)
	print(len(ans))
	print(*ans)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = sorted([a[i] for i in range(n)])
	l = 0
	r = n - 1
	m = 0
	good = n
	while l <= r:
		m = l + r >> 1
		s = b[m]
		fl = True
		for i in range(n):
			if i == m:
				continue
			elif s >= b[i]:
				s += b[i]
			else:
				s = -1
		if s >= 0:
			good = m
			r = m - 1
		else:
			l = m + 1
	ans = []
	for i in range(n):
		if a[i] >= b[good]:
			ans.append(i + 1)
	print(len(ans))
	for val in ans:
		print(val, end=' ')
	print()


from bisect import insort_left
from collections import deque
T = int(input())
for _ in range(T):
	N = int(input())
	ori_nums = list(map(int, input().split()))
	nums = []
	for i in range(N):
		nums.append((ori_nums[i], i + 1))
	nums.sort()
	presum = [0]
	for i in range(N):
		presum.append(presum[-1] + nums[i][0])
	can = set([i + 1 for i in range(N)])
	idx = -1
	for i in range(N - 1):
		if presum[i + 1] < nums[i + 1][0]:
			idx = i
	for i in range(idx + 1):
		can.remove(nums[i][1])
	print(len(can))
	print(' '.join(list(map(str, sorted(can)))))


t = int(input())
for i in range(t):
	k = -1
	n = int(input())
	a = list(map(int, input().split(' ')))
	for i in range(len(a)):
		a[i] = (a[i], i + 1)
	a.sort()
	b = [0] * len(a)
	b[0] = a[0][0]
	for i in range(len(a)):
		b[i] = a[i][0] + b[i - 1]
	for i in range(len(a) - 1):
		if b[i] < a[i + 1][0]:
			k = i
	p = n - 1 - k
	print(p)
	b = [0] * p
	for i in range(k + 1, n):
		b[i - k - 1] = a[i][1]
	b.sort()
	for i in range(len(b)):
		print(b[i], end=' ')
	print('')


def inl():
	return [int(i) for i in input().split()]

def inp():
	return int(input())
for _ in range(inp()):
	n = inp()
	a = inl()
	s = [[a[i], i] for i in range(n)]
	s.sort()
	prefix = [0] * n
	for i in range(n):
		prefix[i] = s[i][0]
	for i in range(1, n):
		prefix[i] += prefix[i - 1]
	vis = [0] * n
	cnt = 0
	for i in range(n - 2, -1, -1):
		if prefix[i] >= s[i + 1][0]:
			vis[s[i][1]] = 1
			cnt += 1
		else:
			break
	vis[s[n - 1][1]] = 1
	print(cnt + 1)
	for i in range(n):
		if vis[i]:
			print(i + 1, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	a = sorted(zip(map(int, input().split()), range(n)))
	(l, r) = (0, n - 1)
	while l < r:
		m = (l + r) // 2
		s0 = sum((a[i][0] for i in range(m + 1)))
		flag = True
		for i in range(m + 1, n):
			if a[i][0] <= s0:
				s0 += a[i][0]
			else:
				flag = False
				break
		if flag:
			r = m
		else:
			l = m + 1
	f = []
	for i in range(l, n):
		f.append(a[i][1] + 1)
	print(len(f))
	print(*sorted(f))


def solve(a):
	prefix_sum = 0
	a_enumerated = list(enumerate(a))
	a_sorted = list(sorted(a_enumerated, key=lambda x: x[1]))
	li = []
	for i in range(0, len(a) - 1):
		prefix_sum += a_sorted[i][1]
		if prefix_sum >= a_sorted[i + 1][1]:
			li.append(a_sorted[i][0])
		else:
			li = []
	li.append(a_sorted[len(a_sorted) - 1][0])
	print(len(li))
	print(' '.join(map(lambda x: str(x + 1), sorted(li))))

def main():
	x = input()
	for _ in range(int(x)):
		input()
		a = input()
		solve(list(map(int, a.split())))
main()


from collections import defaultdict
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	cur = 0
	prefixsum = []
	suffixsum = []
	sl = sorted(l)
	for i in sl:
		cur += i
		prefixsum.append(cur)
	cur = 0
	for i in range(n - 1, -1, -1):
		cur += sl[i]
		suffixsum.append(cur)
	suffixsum = suffixsum[::-1]
	ispossible = [False for _ in range(n)]
	ispossible[-1] = True
	cnt = 1
	res = []
	d = defaultdict(list)
	for i in range(n):
		d[l[i]].append(i + 1)
	for i in range(n - 2, -1, -1):
		if prefixsum[i] >= sl[i + 1] and ispossible[i + 1]:
			ispossible[i] = True
			res.append(d[sl[i]].pop())
			cnt += 1
		else:
			break
	res.append(d[sl[-1]].pop())
	print(cnt)
	res.sort()
	print(*res)


import sys
import math
from itertools import permutations
from bisect import bisect_left

def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()

def FACT(n, mod):
	s = 1
	facts = [1]
	for i in range(1, n + 1):
		s *= i
		s %= mod
		facts.append(s)
	return facts[n]

def C(n, k, mod):
	return FACT(n, mod) * pow(FACT(k, mod) * FACT(n - k, mod) % mod, mod - 2, mod) % mod
for _ in range(II()):
	n = II()
	a = LI()
	inds = [i for i in range(1, n + 1)]
	inds = [x for (_, x) in sorted(zip(a, inds))]
	a.sort()
	d = []
	s = 0
	for i in range(n):
		s += a[i]
		d.append(s)
	l = n - 2
	while l >= 0:
		if d[l] >= a[l + 1]:
			l -= 1
		else:
			break
	ans = sorted(inds[l + 1:])
	print(len(ans))
	print(*ans)


get_line = lambda type_: list(map(type_, input().strip().split()))

def solve():
	n = int(input())
	ori_a = get_line(int)
	a = ori_a.copy()
	a.sort()
	lower_bound = 0
	min_ = a[0]
	min_cnt = 1
	carry = 0
	for i in range(1, n):
		if a[i] == min_:
			min_cnt += 1
		else:
			if min_cnt * min_ + carry < a[i]:
				lower_bound = a[i]
			carry += min_cnt * min_
			min_ = a[i]
			min_cnt = 1
	ans = []
	for i in range(n):
		if ori_a[i] >= lower_bound:
			ans.append(str(i + 1))
	print(len(ans))
	print(' '.join(ans))
t = int(input())
for _ in range(t):
	solve()


import sys
input = sys.stdin.readline
t = int(input())
while t:
	t -= 1
	n = int(input())
	a = list(map(int, input().split()))
	m = sum(a)
	for i in range(n):
		a[i] = [a[i], i]
	ans = []
	a.sort()
	a.reverse()
	p = [[i[0], i[1]] for i in a]
	p[0][0] = m
	m -= a[0][0]
	for i in range(1, n):
		m -= a[i][0]
		if a[i][0] == a[i - 1][0]:
			p[i][0] = p[i - 1][0]
		else:
			p[i][0] += m
		if p[i][0] >= a[i - 1][0]:
			p[i][0] = p[i - 1][0]
	ans.append(p[0][1] + 1)
	for i in range(1, n):
		if p[i][0] >= a[0][0]:
			ans.append(p[i][1] + 1)
	ans.sort()
	print(len(ans))
	for i in ans:
		print(i, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split(' ')))
	aa = [[a[i], i] for i in range(n)]
	aa = sorted(aa, key=lambda aa: [aa[0]], reverse=True)
	s = sum(a)
	ind = 0
	for i in range(n):
		s -= aa[i][0]
		if s < aa[i][0]:
			ind = i
			break
	print(ind + 1)
	aa = sorted(aa[:ind + 1], key=lambda aa: [aa[1]])
	for ai in aa:
		print(ai[1] + 1, end=' ')
	print('')


import os
import sys
from io import BytesIO, IOBase

def solve():
	n = int(input())
	a = list(map(int, input().split()))
	b = sorted(range(1, n + 1), key=lambda x: a[x - 1])
	su = sum(a) - a[b[-1] - 1]
	for i in range(n - 2, -1, -1):
		if su < a[b[i + 1] - 1]:
			print(n - i - 1)
			print(*sorted(b[i + 1:]))
			return
		su -= a[b[i] - 1]
	print(n)
	print(*range(1, n + 1))

def main():
	for _ in range(int(input())):
		solve()
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for t in range(int(input())):
	input()
	s = 0
	z = []
	for (x, i) in sorted(((x, i + 1) for (i, x) in enumerate(map(int, input().split())))):
		if s < x:
			z = []
		s += x
		z.append(i)
	print(len(z))
	print(' '.join(map(str, sorted(z))))


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = sorted(a)
	c = [b[0]]
	for i in range(1, n):
		c.append(c[-1] + b[i])
	border = b[0]
	for i in range(n - 1):
		if c[i] < b[i + 1]:
			border = b[i + 1]
	ans = []
	for i in range(n):
		if a[i] >= border:
			ans.append(i + 1)
	print(len(ans))
	print(' '.join((str(n) for n in ans)))


for _ in range(int(input())):
	n = int(input())
	s = list(map(int, input().split()))
	a = []
	for i in range(n):
		a.append([s[i], i])
	a.sort()
	pref = [0] * n
	pref[0] = a[0][0]
	for i in range(n):
		pref[i] = a[i][0] + pref[i - 1]
	canwin = [0] * n
	canwin[-1] = 1
	ans = [a[-1][1] + 1]
	for i in range(n - 2, -1, -1):
		if pref[i] >= a[i + 1][0] and canwin[i + 1] == 1:
			canwin[i] = 1
			ans.append(a[i][1] + 1)
	print(len(ans))
	print(*sorted(ans))


from math import sqrt
from math import floor
from math import ceil

def croot(x):
	return x ** (1.0 / 3.0)
t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	brr = sorted(arr)
	s = sum(arr)
	ind = 0
	for i in range(n - 1, -1, -1):
		if brr[i] > s - brr[i]:
			ind = i
			while ind > 0 and brr[ind - 1] == brr[ind]:
				ind -= 1
			break
		s -= brr[i]
	print(n - ind)
	for i in range(n):
		if arr[i] >= brr[ind]:
			print(i + 1, end=' ')
	print()


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(n, values) = (int(input()), [int(i) for i in input().split()])
	values = list(sorted([[values[i]] + [i] for i in range(n)]))
	(winner, psa, ans) = ([False for i in range(n - 1)] + [True], [0], [values[-1][1] + 1])
	for i in range(n):
		psa.append(psa[i] + values[i][0])
	psa.pop(0)
	for i in range(n - 2, -1, -1):
		if psa[i] >= values[i + 1][0] and winner[i + 1]:
			winner[i] = True
			ans.append(values[i][1] + 1)
	print(len(ans))
	print(*list(sorted(ans)))


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = []
	for i in range(n):
		b.append((a[i], i))
	b.sort()
	l = 0
	c = []
	temp = 0
	for i in range(0, n - 1):
		temp += b[i][0]
		if temp >= b[i + 1][0]:
			c.append(b[i][1] + 1)
			l += 1
		else:
			c.clear()
			l = 0
	c.append(b[n - 1][1] + 1)
	c.sort()
	l += 1
	print(l)
	print(*c)


import sys
r = sys.stdin.readline
for _ in range(int(r())):
	N = int(r())
	L = list(map(int, r().split()))
	M = max(L)
	SL = []
	for i in range(N):
		SL.append((L[i], i))
	SL.sort()
	idx = 1
	m = SL[0][0]
	S = SL[0][0]
	ans = [SL[0][1]]
	if N == 1:
		print(1)
		print(1)
		continue
	while 1:
		if idx >= N:
			break
		if SL[idx][0] <= S:
			S += SL[idx][0]
			ans.append(SL[idx][1])
		else:
			ans = [SL[idx][1]]
			S += SL[idx][0]
		idx += 1
	ans.sort()
	print(len(ans))
	for i in ans:
		print(i + 1, end=' ')
	print()


def solve(A, n):
	if n == 1:
		return [1]
	B = sorted(A)
	winningValsStartIndex = 0
	runningSum = B[0]
	for i in range(1, n):
		if runningSum < B[i]:
			winningValsStartIndex = i
		runningSum += B[i]
	minWinValue = B[winningValsStartIndex]
	result = []
	for i in range(n):
		if A[i] >= minWinValue:
			result.append(i + 1)
	return result
t = int(input())
for tc in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	result = solve(A, n)
	print(len(result))
	print(*result)


def main(n, a):
	dicti = {}
	for i in range(n):
		if a[i] not in dicti:
			dicti[a[i]] = [i + 1]
			continue
		dicti[a[i]].append(i + 1)
	dp = [0] * n
	a.sort()
	dp[0] = a[0]
	for i in range(1, n):
		dp[i] = dp[i - 1] + a[i]
	scores = {}
	for i in range(n):
		if a[i] not in scores:
			scores[a[i]] = dp[i]
		scores[a[i]] = max(dp[i], scores[a[i]])
	book = []
	score = []
	maxscore = []
	for (x, y) in scores.items():
		score.append(x)
		maxscore.append(y)
	book = []
	for i in range(len(scores) - 1):
		if maxscore[i] >= score[i + 1]:
			book.append(score[i])
		else:
			book = []
	book.append(score[-1])
	res = []
	for i in range(len(book)):
		temp = dicti[book[i]]
		for t in temp:
			res.append(t)
	res.sort()
	return res
k = int(input())
for _ in range(k):
	n = int(input())
	a = list(map(int, input().split()))
	res = main(n, a)
	print(len(res))
	print(*res, sep=' ')


from sys import stdin
nii = lambda : map(int, stdin.readline().split())
lnii = lambda : list(map(int, stdin.readline().split()))
t = int(input())
for tt in range(t):
	n = int(input())
	a = lnii()
	a_s = sorted(a)
	s = sum(a)
	for i in range(n - 1, -1, -1):
		s -= a_s[i]
		if s < a_s[i]:
			num = a_s[i]
			break
	ans = [i + 1 for i in range(n) if a[i] >= num]
	print(len(ans))
	print(*ans)


def f(arr):
	lst = [[arr[i], i] for i in range(len(arr))]
	arr = sorted(arr)
	c = 0
	i = 0
	mx = max(arr)
	lst = sorted(lst, key=lambda s: s[0])
	while i < len(arr):
		c += arr[i]
		flag = True
		for j in range(i + 1, len(arr)):
			if c >= arr[j]:
				c += arr[j]
			else:
				flag = False
				i = j
				break
		if flag:
			break
	print(len(arr) - i)
	ans = []
	for k in range(i, len(arr)):
		ans.append(lst[k][1] + 1)
	return sorted(ans)
for i in range(int(input())):
	a = int(input())
	lst = list(map(int, input().strip().split()))
	print(*f(lst))


t = int(input())
for i in range(t):
	n = int(input())
	arr = [int(x) for x in input().split()]
	s = 0
	ans = 0
	arr1 = sorted(arr)
	for i in range(n):
		if arr1[i] > s:
			ans = i
		s += arr1[i]
	pos = arr1[i:]
	ns = []
	for j in range(n):
		if arr[j] >= arr1[ans]:
			ns.append(str(j + 1))
	print(n - ans)
	print(' '.join(ns))


def find():
	n = int(input())
	mas = tuple(map(int, input().split()))
	sort_mas = sorted(mas)
	dif = 0
	res = sort_mas[0]
	for j in range(n - 1):
		if sort_mas[j] + dif < sort_mas[j + 1]:
			res = sort_mas[j + 1]
		dif += sort_mas[j]
	ans = []
	for j in range(n):
		if mas[j] >= res:
			ans.append(j + 1)
	print(len(ans))
	print(*ans)
for i in range(int(input())):
	find()