Putata has a sequence $$$p$$$ of length $$$n$$$, where $$$p$$$ is a permutation of $$$1,2,\dots,n$$$. Budada can perform the following operation at most $$$2n + 1$$$ times:
Budada wants to make the lexicographical order of the permutation as small as possible after no more than $$$2n+1$$$ operations. Please help him find the way to perform operations so that the lexicographical order of the permutation is as small as possible.
A permutation is an array where each integer from $$$1$$$ to $$$s$$$ (where $$$s$$$ is the size of permutation) occurs exactly once.
A permutation $$$a$$$ is lexicographically smaller than a permutation $$$b$$$ if and only if the following condition holds:
The input contains several test cases.
The first line contains an integer $$$T$$$ ($$$1\leq T\leq 120$$$), denoting the number of test cases.
For each test case, the first line contains an integer $$$n$$$ ($$$3\leq n \leq 1000$$$), denoting the length of the permutation.
The second line contains $$$n$$$ integers, the $$$i$$$-th integer is $$$p_i$$$ ($$$1\leq p_i \leq n$$$), denoting the permutation. It is guaranteed that $$$p$$$ is a permutation of $$$1,2,\dots, n$$$.
It is guaranteed that the sum of $$$n$$$ in all test cases will not exceed $$$1000$$$.
For each test case, output one integer $$$m$$$ in the first line, denoting the number of operations. You should guarantee that $$$0\leq m\leq 2n + 1$$$.
Then output $$$m$$$ lines, each line contains two integers $$$x, y$$$, denoting one operation. You should guarantee that $$$0 \lt x$$$, $$$0 \lt y$$$, $$$x+y \lt n$$$.
Please notice that you do not have to minimize the number of operations.
2 3 1 3 2 5 4 1 2 3 5
0 2 2 1 1 1
| Название |
|---|


