🏡 index : github.com/captn3m0/codechef.git

---
{"category_name":"school","problem_code":"JAVELIN","problem_name":"Javelin Qualification","problemComponents":{"constraints":"- $1 \\leq T \\leq 1000$\n- $2 \\leq X \\leq N \\leq 30$\n- $5000 \\leq A_i \\leq 8000$\n- $7000 \\leq M \\leq 8000$\n- All $A_i$-s are distinct","constraintsState":true,"subtasks":"","subtasksState":false,"inputFormat":"- The first line of input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.\n- The first line of each test case contains three space-separated integers $N, M, X$.\n- The second line of each test case contains $N$ space-separated integers $A_1, A_2, \\dots, A_N$.\n","inputFormatState":true,"outputFormat":"- For each test case, print a single line containing $K + 1$ space-separated integers, where $K$ is the number of players qualified.\n- 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\u0027 *ID* who qualified for the finals. \n- You have to print the IDs of the qualified players in increasing order.","outputFormatState":true,"sampleTestCases":{"0":{"id":1,"input":"3\n3 8000 2\n5000 5001 5002\n3 5000 2\n7999 7998 8000\n4 6000 3\n5999 5998 6000 6001","output":"2 2 3\n3 1 2 3\n3 1 3 4","explanation":"**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\u0027t selected.\n\n**Test Case $2$:** Since all the players cross the qualification mark, they all are selected.\n\n**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.","isDeleted":false}}},"video_editorial_url":"https://youtu.be/1NrJf7X7QZk","languages_supported":{"0":"CPP14","1":"C","2":"JAVA","3":"PYTH 3.6","4":"CPP17","5":"PYTH","6":"PYP3","7":"CS2","8":"ADA","9":"PYPY","10":"TEXT","11":"PAS fpc","12":"NODEJS","13":"RUBY","14":"PHP","15":"GO","16":"HASK","17":"TCL","18":"PERL","19":"SCALA","20":"LUA","21":"kotlin","22":"BASH","23":"JS","24":"LISP sbcl","25":"rust","26":"PAS gpc","27":"BF","28":"CLOJ","29":"R","30":"D","31":"CAML","32":"FORT","33":"ASM","34":"swift","35":"FS","36":"WSPC","37":"LISP clisp","38":"SQL","39":"SCM guile","40":"PERL6","41":"ERL","42":"CLPS","43":"ICK","44":"NICE","45":"PRLG","46":"ICON","47":"COB","48":"SCM chicken","49":"PIKE","50":"SCM qobi","51":"ST","52":"SQLQ","53":"NEM"},"max_timelimit":0.5,"source_sizelimit":50000,"problem_author":"daanish_adm","problem_tester":"","date_added":"9-08-2021","tags":{"0":"cakewalk","1":"daanish_adm","2":"start8"},"problem_difficulty_level":"Unavailable","best_tag":"","editorial_url":"https://discuss.codechef.com/problems/JAVELIN","time":{"view_start_date":1629124200,"submit_start_date":1629124200,"visible_start_date":1629124200,"end_date":1735669800},"is_direct_submittable":false,"problemDiscussURL":"https://discuss.codechef.com/search?q=JAVELIN","is_proctored":false,"visitedContests":{},"layout":"problem"}
---
### Read problem statements in [Russian](https://www.codechef.com/download/translated/START8/russian/JAVELIN.pdf), [Mandarin Chinese](https://www.codechef.com/download/translated/START8/mandarin/JAVELIN.pdf), [Bengali](https://www.codechef.com/download/translated/START8/bengali/JAVELIN.pdf), and [Vietnamese](https://www.codechef.com/download/translated/START8/vietnamese/JAVELIN.pdf) 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.

<aside style='background: #f8f8f8;padding: 10px 15px;'><div>All submissions for this problem are available.</div></aside>