Given an undirected graph with $$$n$$$ vertices ($$$n$$$ is even) and also given $$$n$$$ integers $$$a_1, a_2, \cdots, a_n$$$, for all positive integers $$$i$$$ and $$$j$$$ satisfying $$$1 \le i \lt j \le n$$$ and $$$|i - j| = |a_{i} - a_{j}|$$$ ($$$|x|$$$ indicates the absolute value of $$$x$$$) we connect vertices $$$i$$$ and $$$j$$$ with an undirected edge in the graph. It's obvious that this undirected graph does not contain self loops or multiple edges.
Find a perfect matching of this undirected graph, or state that a perfect matching does not exist.
Recall that a perfect matching of a graph is a subset of size $$$\frac{n}{2}$$$ of all the edges in the graph, such that each vertex in the graph is connected by one edge in this subset.
There are multiple test cases. The first line of the input contains an integer $$$T$$$ indicating the number of test cases. For each test case:
The first line contains an even integer $$$n$$$ ($$$2 \le n \le 10^5$$$) indicating the number of vertices in the undirected graph.
The second line contains $$$n$$$ integers $$$a_1, a_2, \cdots, a_n$$$ ($$$-10^9 \le a_i \le 10^9$$$).
It's guaranteed that the sum of $$$n$$$ of all test cases does not exceed $$$10^6$$$.
For each test case, if there does not exist a perfect matching output "No" (without quotes) in one line; If there exists a perfect matching first output "Yes" (without quotes) in one line, then output $$$\frac{n}{2}$$$ lines where the $$$i$$$-th line contains two integers $$$u_i$$$ and $$$v_i$$$ separated by a space indicating the two vertices connected by the $$$i$$$-th edge in the perfect matching. If there are multiple valid answers, output any.
3614 22 33 11 25 364100 10 98 1241 3 5 7
Yes 1 4 5 2 6 3 Yes 1 3 4 2 No
| Название |
|---|


