You are given that \(N\) candidates participated in a contest. For each candidate, you are given \(A_i\), representing the points scored by the \(i^{th}\) candidate in the contest. You have to print the indexes of the top \(K\) candidates of the contest.
Note: \(A_i \ne A_j \forall i \ne j\) i.e, all \(A_i\)are distinct.
Input format
- First line: Two space-separated integers \(N\) and \(K\)
- Next line: \(N\) space-separated integers. The \(i^{th}\)integer denotes the points scored by the \(i^{th}\)candidate in the contest.
Output format
- Print \(K\) space-separated integers, denoting the indexes of the top \(K\) candidates.
Constraints
\(1 \le N \le 10^{5}\)
\(1 \le K \le N\)
\(1 \le A_i \le 10^{9}\)
The points scored by candidates are \(25, 5, 17, 10, 45\). The points scored by top \(3\) candidates of the contest are \(45, 25, 17\). Indexes of those points are \(5, 1, 3\) respectively.
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor