There is a class of **N** students and the task is to find the top **K** marks scorers. You need to print the index of the toppers of the class which will be same as the index of the student in the input array (use 0-based indexing). First print the index of the students having highest marks then the students with second highest and so on. If there are more than one students having same marks then print their indices in ascending order.Suppose k = 2 and the students having highest marks have indices 0 and 5 and students having second highest marks have indices 6 and 7 then output will be 0 5 6 7.

**Input:**

The first line of input consists of an integer T denoting the number of test cases .Each test case consists of three lines first line consists of an integer N denoting the number of students of class second line consists N spaced integers denoting the marks of students and third line consists of an integer K which denotes the number of top scores you have to find.

**Output:**

Single line output, denoting the indices of top k cores with space between them.

**Constraints:**

1 <= T <= 100

1 <= N <= 1000

1 <= marks of students <= 10^{6}

It is given that k will be such that its value will always be less than or equal to type of marks of students

**Example:
Input**

1

5

2 2 1 3 1

2

3 0 1

**Explanation:
Testcase 1:** Topper with 3 marks is present at 3rd index, 2 marks is present at 0

Author: Ayush jha

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

agness | 122 |

aman1931998 | 102 |

Survivor | 100 |

uchitnitk | 96 |

lonecoder | 95 |

KshatriyaYash | 1066 |

nikhil_sojan | 1032 |

lonecoder | 1030 |

mazumderrohit8 | 899 |

SumitSingh27 | 832 |

blackshadows | 5327 |

Ibrahim Nash | 5215 |

akhayrutdinov | 5111 |

mb1973 | 4492 |

Quandray | 4444 |

Login to report an issue on this page.