Read problem statements in [Russian], [Mandarin Chinese], [Bengali], and [Vietnamese] as well.

There are N players with IDs from 1 to N, who are participating in the Javelin throw competition which has two rounds. The first is the qualification round, followed by the final round. The qualification round has gotten over, and you are given the longest distance that each of the N players has thrown as A_{1}, A_{2}, \ldots, A_{N}. Now, the selection process for the final round happens in the following two steps:

1) If the longest throw of a player in the qualification round is greater than or equal to the qualification mark of M cm, they qualify for the final round.

2) If after step 1, less than X players have qualified for the finals, the remaining spots are filled by players who have thrown the maximum distance among the players who have not qualified yet.

You are given the best throws of the N players in the qualification round A_{1}, A_{2}, \ldots, A_{N} and the integers M and X. Print the list of the players who will qualify for the finals in increasing order of their IDs.

------ Input Format ------ 

- The first line of input contains a single integer T denoting the number of test cases. The description of T test cases follows.
- The first line of each test case contains three space-separated integers N, M, X.
- The second line of each test case contains N space-separated integers A_{1}, A_{2}, \dots, A_{N}.

------ Output Format ------ 

- For each test case, print a single line containing K + 1 space-separated integers, where K is the number of players qualified.
- First, print the integer K, then followed by a space, print K space-separated integers ID_{1}, ID_{2}, \dots, ID_{K} where ID_{i} denotes the players' *ID* who qualified for the finals. 
- You have to print the IDs of the qualified players in increasing order.

------ Constraints ------ 

$1 ≤ T ≤ 1000$
$2 ≤ X ≤ N ≤ 30$
$5000 ≤ A_{i} ≤ 8000$
$7000 ≤ M ≤ 8000$
- All $A_{i}$-s are distinct

----- Sample Input 1 ------ 
3
3 8000 2
5000 5001 5002
3 5000 2
7999 7998 8000
4 6000 3
5999 5998 6000 6001
----- Sample Output 1 ------ 
2 2 3
3 1 2 3
3 1 3 4
----- explanation 1 ------ 
Test Case $1$: Since no player crosses the qualification mark, they are chosen based on the distance thrown. So player $3$ who has thrown the maximum distance gets selected followed by the player $2$. Now since we have got the required number of players, player $1$ isn't selected.

Test Case $2$: Since all the players cross the qualification mark, they all are selected.

Test Case $3$: The player $3$ and player $4$ cross the qualification mark. So for the third and final spot in the final, the player $1$ is selected since he has the maximum distance thrown amongst the remaining two players.

Difficulty: MEDIUM

Solutions:
for _ in range(int(input())):
	(n, m, x) = map(int, input().split())
	lis = list(map(int, input().split()))
	ans = []
	lvl2 = []
	for i in range(n):
		if lis[i] >= m:
			ans.append(i + 1)
		else:
			lvl2.append((lis[i], i + 1))
	if len(ans) >= x:
		print(len(ans), *ans)
	else:
		lvl2.sort(reverse=True)
		l = [lvl2[i][1] for i in range(x - len(ans))]
		ans += l
		ans.sort()
		print(x, *ans)


(p, o) = (0, 1)
k = int(input())
for z in range(k):
	(n, n1, n2) = map(int, input().split())
	A = list(map(int, input().split()))
	s = []
	for i in range(n):
		if A[i] >= n1:
			s.append(i + 1)
	if len(s) < n2:
		flag = [[A[i], i + 1] for i in range(n) if A[i] < n1]
		flag.sort(key=lambda n2: (n2[0], n2[1]))
		flag = flag[::-1]
		i = 0
		while len(s) < n2:
			s.append(flag[i][1])
			i += 1
	s.sort()
	print(len(s), *s)


test = int(input())
for z in range(test):
	(n, m, x) = map(int, input().split())
	A = list(map(int, input().split()))
	ans = []
	for i in range(n):
		if A[i] >= m:
			ans.append(i + 1)
	if len(ans) < x:
		temp = [[A[i], i + 1] for i in range(n) if A[i] < m]
		temp.sort(key=lambda x: (x[0], x[1]))
		temp = temp[::-1]
		i = 0
		while len(ans) < x:
			ans.append(temp[i][1])
			i += 1
	ans.sort()
	print(len(ans), *ans)


a = int(input())
for i in range(a):
	(b, c, d) = map(int, input().split())
	e = list(map(int, input().split()))
	f = 0
	h = []
	z = 0
	for i in range(len(e)):
		if e[i] >= c:
			f = f + 1
			h.append(i + 1)
	if f < d:
		for i in range(d - f):
			k = 0
			hh = 0
			for j in range(b):
				if e[j] < c and e[j] > k:
					k = e[j]
					hh = j
			e[hh] = -668888
			h.append(hh + 1)
	if f > d:
		z = f
	else:
		z = d
	print(z, end=' ')
	h.sort()
	print(*h)


for i in range(int(input())):
	(n, m, x) = map(int, input().split())
	a = list(map(int, input().split()))
	q = []
	f = []
	for i in range(n):
		if a[i] >= m:
			q.append(i + 1)
		else:
			f.append([a[i], i + 1])
	if len(q) < x:
		f.sort(reverse=True)
		x -= len(q)
		for i in range(x):
			q.append(f[i][1])
	q.sort()
	print(len(q), *q)


for _ in range(int(input())):
	(n, m, x) = list(map(int, input().split()))
	l = list(map(int, input().split()))
	for i in range(1, n + 1):
		l[i - 1] = [l[i - 1], i]
	l.sort(reverse=True)
	ans = []
	for i in range(x):
		if x > len(ans):
			ans.append(l[i][1])
	while x < len(l) and l[x][0] >= m:
		ans.append(l[x][1])
		x += 1
	ans.sort()
	print(len(ans), *ans)


import sys
for i in range(int(input())):
	(n, m, xx) = map(int, input().split())
	a = list(map(int, sys.stdin.readline().strip().split()))
	selected = []
	x = 0
	a = list(enumerate(a))
	a.sort(key=lambda x: x[1], reverse=True)
	r = []
	x = 0
	while x < n and a[x][1] >= m:
		r += [a[x]]
		x += 1
	if len(r) < xx:
		while len(r) < xx:
			r += [a[x]]
			x += 1
	r.sort(key=lambda x: x[0])
	print(len(r), *[el[0] + 1 for el in r])


t = int(input())
for tstcases in range(t):
	(n, m, x) = map(int, input().split())
	l1 = []
	l2 = []
	count = 0
	A = list(map(int, input().split()))
	for i in range(len(A)):
		if A[i] >= m:
			l1.append(i + 1)
			count += 1
		else:
			l2.append(A[i])
	l2.sort(reverse=True)
	if len(l1) == x:
		print(count, *l1)
	else:
		for j in range(x - len(l1)):
			count += 1
			l1.append(A.index(l2[j]) + 1)
		l1.sort()
		print(count, *l1)


for _ in range(int(input())):
	(n, m, x) = map(int, input().split())
	arr = list(map(int, input().split()))
	res = {k: v + 1 for (v, k) in enumerate(arr)}
	arr.sort(reverse=True)
	ans = []
	for i in arr:
		if i >= m:
			ans.append(res.get(i))
			x -= 1
		elif x > 0:
			ans.append(res.get(i))
			x -= 1
		else:
			break
	ans.sort()
	print(len(ans), *ans)


for i in range(int(input())):
	(n, m, x) = map(int, input().split())
	a = list(map(int, input().split()))
	b = []
	c = []
	for j in range(n):
		if a[j] >= m:
			b.append(j + 1)
		else:
			c.append([a[j], j + 1])
	if len(b) < x:
		c.sort(reverse=True)
		x -= len(b)
		for z in range(x):
			b.append(c[z][1])
	b.sort()
	print(len(b), *b)


tests = int(input())
for i in range(tests):
	(n, m, x) = map(int, input().split())
	arr = list(map(int, input().split()))
	dict1 = {}
	players = 0
	for j in range(n):
		dict1[arr[j]] = j
	ans = []
	sorted_arr = sorted(list(dict1.keys()), reverse=True)
	for j in sorted_arr:
		if players < x or j >= m:
			players += 1
			ans.append(dict1[j] + 1)
	ans.sort()
	print(players, *ans)


for _ in range(int(input())):
	(n, m, x) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	an = a.copy()
	an.sort(reverse=True)
	p = []
	q = []
	for i in range(n):
		if an[i] >= m:
			p.append(a.index(an[i]) + 1)
		else:
			q.append(a.index(an[i]) + 1)
	if len(p) != x:
		for i in range(x - len(p)):
			p.append(q[i])
	p.sort()
	print(len(p), *p)


def soln(n, m, x, arr):
	inds = {arr[i]: i + 1 for i in range(n)}
	arr.sort()
	res = []
	while arr and arr[-1] >= m:
		res.append(inds[arr.pop()])
	while arr and len(res) < x:
		res.append(inds[arr.pop()])
	return [len(res)] + sorted(res)
for _ in range(int(input())):
	(n, m, x) = map(int, input().split())
	arr = list(map(int, input().split()))
	print(*soln(n, m, x, arr))


for _ in range(int(input())):
	(n, mark, x) = map(int, input().split())
	a = list(map(int, input().split()))
	b = {}
	for i in range(n):
		b[a[i]] = i + 1
	a.sort()
	c = []
	for i in range(n):
		if a[-1] < mark:
			c = a[n - x:]
			break
		if a[i] >= mark:
			if n - i < x:
				c = a[n - x:]
			else:
				c = a[i:]
			break
	for i in range(len(c)):
		c[i] = b[c[i]]
	c.sort()
	print(len(c), *c)


from sys import stdin
ip = stdin.readline
from operator import itemgetter
for _ in range(int(ip())):
	(n, m, x) = map(int, ip().split())
	li = list(map(int, ip().split()))
	ad = [(i + 1, li[i]) for i in range(n)]
	ad = sorted(ad, key=itemgetter(1))
	ad = ad[::-1]
	ans = []
	for i in ad:
		if i[1] >= m:
			ans.append(i[0])
		elif len(ans) < x:
			ans.append(i[0])
	ans.sort()
	print(len(ans), *ans, sep=' ')


def player_list(N, M, X, tr):
	pl_id = list()
	re = list()
	fre_id = dict()
	mi = min(tr)
	if mi >= M:
		return [i + 1 for i in range(N)]
	for i in range(N):
		fre_id[tr[i]] = i + 1
	tr = sorted(tr, reverse=True)
	c = 0
	for i in range(N):
		if tr[i] >= M:
			pl_id.append(fre_id[tr[i]])
			c += 1
		else:
			re.append(fre_id[tr[i]])
	if c < X:
		for i in range(X - c):
			pl_id.append(re[i])
	return sorted(pl_id)
T = int(input())
for _ in range(T):
	(N, M, X) = list(map(int, input().split()))
	tr = list(map(int, input().split()))
	idq = player_list(N, M, X, tr)
	print(len(idq), *idq)


t = int(input())
for _ in range(t):
	(n, m, x) = map(int, input().split())
	l = list(map(int, input().split()))
	f = list(filter(lambda z: z >= m, l))
	if len(f) < x:
		a = sorted(l)[n - x:]
		res = str(x)
		for i in list(filter(lambda y: y in a, l)):
			res += ' ' + str(l.index(i) + 1)
	else:
		res = str(len(f))
		for j in f:
			res += ' ' + str(l.index(j) + 1)
	print(res)


testCases = int(input())
for testCase in range(testCases):
	(n, m, x) = map(int, input().split())
	a = list(map(int, input().split()))
	d = {k: v + 1 for (v, k) in enumerate(a)}
	a.sort(reverse=True)
	ans = []
	for i in a:
		if i >= m:
			ans.append(d.get(i))
			x -= 1
		elif x > 0:
			ans.append(d.get(i))
			x -= 1
		else:
			break
	ans.sort()
	print(len(ans), *ans)


testCases = int(input())
for testCase in range(testCases):
	(n, m, x) = map(int, input().split())
	a = list(map(int, input().split()))
	d = {k: v + 1 for (v, k) in enumerate(a)}
	q = []
	nq = []
	for i in a:
		if i >= m:
			q.append(i)
		else:
			nq.append(i)
	if len(q) < x:
		l = len(q)
		for i in range(x - l):
			maxi = max(nq)
			q.append(maxi)
			nq.remove(maxi)
		ans = [d.get(i) for i in q]
		ans.sort()
		print(len(q), *ans)
	else:
		ans = [d.get(i) for i in q]
		ans.sort()
		print(len(q), *ans)


for _ in range(int(input())):
	(n, m, x) = map(int, input().split())
	arr = list(map(int, input().lstrip().split()))
	li = []
	count = 0
	for i in range(n):
		if arr[i] >= m:
			li.append(i + 1)
			arr.pop(i)
			arr.insert(i, 0)
			count += 1
	if count < x:
		q = max(arr)
		i = 0
		while count != x:
			if i == n:
				i = 0
			elif arr[i] == q and count < x:
				li.append(i + 1)
				arr.pop(i)
				arr.insert(i, 0)
				count += 1
				i += 1
				q = max(arr)
			else:
				i += 1
	li.sort()
	li.insert(0, len(li))
	print(*li, sep=' ')


for _ in range(int(input())):
	(n, m, x) = map(int, input().split())
	s = list(map(int, input().split()))
	dic = []
	for i in range(n):
		if s[i] >= m:
			dic.append(i + 1)
	if len(dic) < x:
		se = list(enumerate(s))
		se.sort(key=lambda x: x[1], reverse=True)
		rs = x - len(dic)
		for (i, j) in se:
			if rs != 0 and j < m:
				dic.append(i + 1)
				rs -= 1
	dic.sort()
	print(len(dic), *dic)


from math import gcd, sqrt, ceil, floor, log10, log2
from heapq import heapify, heappop, heappush, nsmallest, nlargest
from collections import Counter, deque, OrderedDict, defaultdict
from itertools import combinations, permutations, zip_longest
from bisect import bisect_left, bisect_right
from functools import lru_cache, reduce
import sys
import time
import string
import operator
RECURSION_LIMIT = int(10000000.0)
INT_MAX = float('inf')
INT_MIN = float('-inf')
MOD = int(1000000000.0) + 7
NEWLINE = '\n'
SPACE = ' '
sys.setrecursionlimit(RECURSION_LIMIT)
inp = lambda fn: fn(input())
inp_vars = lambda fn, delim, convert_to=list: convert_to(map(fn, input().split(delim)))

def inp_graph(n, adj, gtype=0):
	pass

def solve(*args, **kwargs):
	(n, m, x) = args[0]
	arr = args[1]
	mp = {p: val for (p, val) in enumerate(arr, 1) if val >= m}
	if len(mp) >= x:
		return [len(mp)] + sorted(mp.keys())
	x -= len(mp)
	rem = sorted(((p, val) for (p, val) in enumerate(arr, 1) if p not in mp), key=lambda x: x[1])
	return [x + len(mp)] + sorted(list(mp.keys()) + [p for (p, _) in rem[-x:]])

def main(*args, **kwargs):
	for _ in range(int(input())):
		arg2 = inp_vars(int, SPACE)
		arg3 = inp_vars(int, SPACE)
		res = solve(*(arg2, arg3))
		if type(res) in {list, tuple, set}:
			print(*res, sep=' ')
		else:
			print(res)
main()


for _ in range(int(input())):
	(n, m, x) = map(int, input().split())
	a = list(map(int, input().split()))
	s = []
	for i in a:
		if i >= m:
			s.append(a.index(i) + 1)
	l = len(s)
	if l >= x:
		s.insert(0, l)
		print(*s)
	else:
		y = []
		for i in a:
			y.append(i)
		t = x - l
		a.sort(reverse=True)
		for i in range(t):
			for j in a:
				if j < m:
					s.append(y.index(j) + 1)
					m = j
					break
		s.sort()
		s.insert(0, len(s))
		print(*s)


t = int(input())
for _ in range(t):
	(n, m, x) = [int(i) for i in input().split()]
	arr = [int(i) for i in input().split()]
	ans = []
	for i in range(n):
		if arr[i] >= m:
			ans.append(i + 1)
			arr[i] = -1
	while len(ans) < x:
		ind = 0
		jnd = 0
		while ind < n:
			if arr[ind] > arr[jnd]:
				jnd = ind
			ind += 1
		ans.append(jnd + 1)
		arr[jnd] = -1
	res = []
	res.append(len(ans))
	ans.sort()
	for i in ans:
		res.append(i)
	print(*res)


import collections as clts
import math
import heapq

def gcd(x, y):
	if y == 0:
		return x
	else:
		return gcd(y, x % y)

def lcm(x, y):
	return int(x / gcd(x, y) * y)

def take_input(type='int'):
	if type == 'int':
		return int(input())
	elif type == 'str':
		return input()
	elif type == 'list-int':
		return list(map(int, input().split()))
	elif type == 'list-float':
		return list(map(float, input().split()))
	else:
		return None
for _ in range(int(input())):
	(N, M, X) = take_input('list-int')
	A = take_input('list-int')
	quals = []
	idMap = clts.defaultdict(clts.deque)
	for i in range(N):
		if A[i] >= M:
			quals.append(i + 1)
			A[i] = 0
		idMap[A[i]].append(i + 1)
	if len(quals) < X:
		j = len(quals)
		A = sorted(A, reverse=True)
		i = 0
		while j < X:
			quals.append(idMap[A[i]].popleft())
			i += 1
			j += 1
	quals = sorted(quals)
	quals = list(map(str, quals))
	print(len(quals), ' '.join(quals))


for _ in range(int(input())):
	(n, m, x) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	d = {a[i]: i + 1 for i in range(n)}
	c = 0
	s = set()
	ds = sorted(d)
	while ds:
		if ds[-1] >= m:
			ele = ds.pop()
			s.add(d[ele])
			c += 1
		else:
			break
	if c < x:
		while c - x:
			ele = ds.pop()
			s.add(d[ele])
			c += 1
	print(len(s), *sorted(s))


for _ in range(int(input())):
	(n, m, x) = map(int, input().split())
	l = list(map(int, input().split()))
	d = {}
	p = []
	for i in range(n):
		d[l[i]] = i + 1
	l.sort(reverse=True)
	for i in range(n):
		if l[i] >= m:
			p.append(d[l[i]])
			x -= 1
		elif x > 0:
			p.append(d[l[i]])
			x -= 1
		else:
			break
	p.sort()
	print(len(p), *p)


t = int(input())
for i in range(t):
	(n, m, x) = map(int, input().split())
	a = list(map(int, input().split()))
	gg = []
	for i in range(len(a)):
		gg.append([a[i], i + 1])
	gg.sort(key=lambda x: x[0])
	gg = gg[::-1]
	ans = []
	c = 0
	for i in range(len(gg)):
		c += 1
		if gg[i][0] >= m:
			ans.append(gg[i][1])
		elif c <= x:
			ans.append(gg[i][1])
		elif c == x:
			break
	ans.sort()
	ans.insert(0, len(ans))
	for i in range(len(ans)):
		if i == len(ans) - 1:
			print(ans[i])
		else:
			print(ans[i], end=' ')


for _ in range(int(input())):
	(n, m, x) = map(int, input().split())
	a = list(map(int, input().split()))
	res = []
	for i in range(n):
		if a[i] >= m:
			res.append([a[i], i + 1])
	if len(res) < x:
		res.extend(sorted(zip(a, range(1, n + 1)), reverse=True)[len(res):x])
	ans = str(len(res)) + ' '
	res = list(zip(*res))[1]
	ans += ' '.join(list(map(str, sorted(list(res)))))
	print(ans)


from heapq import heappop, heappush, heapify
t = int(input())
for _ in range(t):
	(n, m, x) = map(int, input().split())
	arr = list(map(int, input().split()))
	res = []
	heap = []
	for (i, j) in enumerate(arr):
		heap.append((-1 * j, i + 1))
	heapify(heap)
	while len(heap):
		(a, b) = heappop(heap)
		if a * -1 >= m or len(res) < x:
			res.append(b)
	res.sort()
	print(len(res), *res)


def solve_case():
	(n, m, k) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	with_ids = [(x, i + 1) for (i, x) in enumerate(a)]
	answer = []
	for (v, i) in sorted(with_ids, reverse=True):
		if len(answer) < k or v >= m:
			answer.append(i)
	print(len(answer), *sorted(answer))
cases = int(input())
for _ in range(cases):
	solve_case()


for _ in range(int(input())):
	(n, m, x) = map(int, input().split())
	a = [int(x) for x in input().split()]
	players = [(x, i + 1) for (i, x) in enumerate(a)]
	ans = []
	for (v, i) in sorted(players, reverse=True):
		if len(ans) < x or v >= m:
			ans.append(i)
	print(len(ans), *sorted(ans))


t = int(input())
for _ in range(t):
	(n, m, x) = map(int, input().split())
	arr = [int(item) for item in input().split()]
	count = 0
	for j in range(n - 1, -1, -1):
		if arr[j] >= m:
			count += 1
			arr[j] = -1
	while x > count:
		pmax = 0
		ind = 0
		for i in range(n):
			if arr[i] > pmax:
				ind = i
				pmax = arr[i]
		arr[ind] = -1
		count += 1
	print(count, end=' ')
	j = 0
	for i in range(n):
		if arr[i] == -1:
			j += 1
			if count > j:
				print(i + 1, end=' ')
			else:
				print(i + 1)


from bisect import *
for i in range(int(input())):
	(n, m, x) = map(int, input().split())
	a = list(map(int, input().split()))
	b = []
	for i in range(len(a)):
		b.append((-a[i], i + 1))
	b.sort()
	l = bisect(b, (-m, float('inf')))
	la = max(l, x)
	ans = []
	for i in range(la):
		ans.append(b[i][1])
	ans.sort()
	print(len(ans), *ans)


try:
	t = int(input())
	for _ in range(t):
		(p, l, k) = list(map(int, input().split()))
		arr = list(map(int, input().split()))
		iarr = [[arr[i], i + 1] for i in range(p)]
		iarr.sort(reverse=True)
		ans = []
		for i in iarr:
			if i[0] >= l:
				ans.append(i[1])
		d = len(ans)
		if d < k:
			ans.extend([iarr[i][1] for i in range(d, k)])
		ans.sort()
		ans.insert(0, len(ans))
		print(' '.join((str(i) for i in ans)))
except:
	pass


for _ in range(int(input())):
	(n, m, x) = map(int, input().split())
	li = list(map(int, input().split()))
	dict = {}
	for i in range(n):
		if li[i] in dict:
			continue
		else:
			dict[li[i]] = i + 1
	li.sort()
	final = li[n - x:]
	for i in range(n - x):
		if li[n - x - 1 - i] >= m:
			final.insert(0, li[n - x - 1 - i])
		else:
			break
	temp = []
	print(len(final), end=' ')
	for j in final:
		temp.append(dict[j])
		dict[j] += 1
	temp.sort()
	print(*temp)


for i in range(int(input())):
	(n, m, x) = map(int, input().split())
	a = list(map(int, input().split()))
	d = {a[i]: i for i in range(n)}
	a.sort(reverse=True)
	c = 0
	i = 0
	ans = []
	while c < x or (i < n and a[i] >= m):
		ans.append(d[a[i]] + 1)
		i += 1
		c += 1
	ans.sort()
	print(c, *ans)


t = int(input())
for _ in range(t):
	(n, m, x) = map(int, input().split())
	a = list(map(int, input().split()))
	ids = []
	non = []
	for i in range(n):
		if a[i] >= m:
			ids.append(i + 1)
		else:
			non.append(a[i])
	rem = x - len(ids)
	non.sort(reverse=True)
	for i in range(rem):
		ids.append(a.index(non[i]) + 1)
	ids.sort(reverse=True)
	ids.append(len(ids))
	ids.reverse()
	print(*ids, sep=' ')