There are several testcases.
There is an positive integer $T(T\leq 30)$ in the first line standing for the number of testcases.
For each testcase, there is an positive integer $n$ in the first line standing for the number of books in this series.
Followed $n$ positive integers separated by space standing for the order of the disordered books,the $ith$ integer stands for the $ith$ book's number(from top to bottom).
Hint:
For the first testcase:Moving in the order of $book3,book2,book1$ ,$(4,1,2,3)\rightarrow (3,4,1,2)\rightarrow(2,3,4,1)\rightarrow(1,2,3,4)$,and this is the best way to reorder the books.
For the second testcase:It's already ordered so there is no operation needed.