Problem: Vanya has a graph with vertices (numbered from to ) and an array of integers; initially, there are no edges in the graph. Vanya got bored, and to have fun, he decided to perform operations.
Operation number (operations are numbered in order starting from ) is as follows:
- Choose different numbers , such that is divisible by .
- Add an undirected edge between vertices and to the graph.
Help Vanya get a connected graph using the operations, or determine that it is impossible.
Input Format: Each test consists of multiple test cases. The first line contains an integer () — the number of test cases. Then follows the description of the test cases.
The first line of each test case contains the number () — the number of vertices in the graph.
The second line of each test case contains numbers ().
It is guaranteed that the sum of over all test cases does not exceed .
Output Format: For each test case, if there is no solution, then output "No" (without quotes).
Otherwise, output "Yes" (without quotes), and then output lines, where in the -th line, output the numbers and that need to be chosen for operation .
You can output each letter in any case (for example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as a positive answer).
Note: Let's consider the second test case.
-
First operation : we can connect vertices and , since , and is divisible by .
-
Second operation : we can connect vertices and , since , and is divisible by .
-
Third operation : we can connect vertices and , since , and is divisible by .