Top contestants

2.1

9 votes
Basic Programming, Basics of Implementation, Easy, Implementation, Java, Python, Quick Sort, Sorting
Problem

You are given that N candidates participated in a contest. For each candidate, you are given Ai, representing the points scored by the ith candidate in the contest. You have to print the indexes of the top K candidates of the contest.

Note: AiAjij i.e, all Aiare distinct.


Input format

  • First line: Two space-separated integers N and K
  • Next line: N space-separated integers. The ithinteger denotes the points scored by the ithcandidate in the contest.

Output format

  • Print K space-separated integers, denoting the indexes of the top K candidates.

Constraints

1N105

1KN

1Ai109

Sample Input
5 3
25 5 17 10 45
Sample Output
5 1 3
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

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.

Editor Image

?