CF489A SwapSort
Description
In this problem your goal is to sort an array consisting of $ n $ integers in at most $ n $ swaps. For the given array find the sequence of swaps that makes the array sorted in the non-descending order. Swaps are performed consecutively, one after another.
Note that in this problem you do not have to minimize the number of swaps — your task is to find any sequence that is no longer than $ n $ .
Input Format
In this problem your goal is to sort an array consisting of $ n $ integers in at most $ n $ swaps. For the given array find the sequence of swaps that makes the array sorted in the non-descending order. Swaps are performed consecutively, one after another.
Note that in this problem you do not have to minimize the number of swaps — your task is to find any sequence that is no longer than $ n $ .
Output Format
In this problem your goal is to sort an array consisting of $ n $ integers in at most $ n $ swaps. For the given array find the sequence of swaps that makes the array sorted in the non-descending order. Swaps are performed consecutively, one after another.
Note that in this problem you do not have to minimize the number of swaps — your task is to find any sequence that is no longer than $ n $ .