Problem D
Bogletics Intermission
Languages
en
is

Input
The first line of the input contains an integer
Output
One line with an integer which gives the minimum number of moves to get the items to their desired locations.
Sample Input 1 | Sample Output 1 |
---|---|
4 1 3 2 4 |
3 |
Sample Input 2 | Sample Output 2 |
---|---|
8 7 4 6 8 1 3 5 2 |
11 |