(String args[])
| 3 | import java.util.*; |
| 4 | class bestCombos { |
| 5 | public static void main(String args[]) |
| 6 | { |
| 7 | Scanner sc=new Scanner(System.in); |
| 8 | |
| 9 | int n=sc.nextInt(); |
| 10 | |
| 11 | int popularity[]=new int[n]; |
| 12 | //input the array |
| 13 | for(int i=0;i<n;i++) |
| 14 | popularity[i]=sc.nextInt(); |
| 15 | |
| 16 | int k=sc.nextInt(); |
| 17 | |
| 18 | int combo[]=bestCombo(popularity,k); |
| 19 | |
| 20 | for(int i=0;i<combo.length;i++) |
| 21 | System.out.println(combo[i]); |
| 22 | |
| 23 | } |
| 24 | |
| 25 | public static int[] bestCombo(int popularity[],int k) |
| 26 | { |