Input Two integers $n,k$ in the first line. Then the second line consists of $n$ integers $\in[1,n]$.
Output $n$ integers representing the result after $k$ rounds of selection sort. If there are multiple maximum value, select the first.
Constraints: $0\le k\le n,1\le n\le 1000$.
Example Input 1
3 1
2 3 1
Example Output 1
1 3 2
Extra Excercise
What if $n\le 10^5$?