```go
package main
import (
"bufio"
"fmt"
"os"
"sort"
)
func main() {
in := bufio.NewReader(os.Stdin)
var t int
fmt.Fscan(in, &t)
for _ = range t {
var n int
fmt.Fscan(in, &n)
a := make([]int, n+1)
for i := 1; i <= n; i++ {
fmt.Fscan(in, &a[i])
}
gangMap := make(map[int][]int)
for i := 1; i <= n; i++ {
gangMap[a[i]] = append(gangMap[a[i]], i)
}
gangs := make([]int, 0, len(gangMap))
for k := range gangMap {
gangs = append(gangs, k)
}
sort.Ints(gangs)
if len(gangs) < 2 {
fmt.Println("NO")
continue
}
special := gangs[0]
list1 := gangMap[special]
c := list1[0]
otherGang := gangs[1]
listOther := gangMap[otherGang]
b := listOther[0]
var edges [][2]int
for j := 1; j < len(list1); j++ {
d := list1[j]
edges = append(edges, [2]int{d, b})
}
for gi := 1; gi < len(gangs); gi++ {
g := gangs[gi]
lst := gangMap[g]
for _, d := range lst {
edges = append(edges, [2]int{d, c})
}
}
fmt.Println("YES")
for _, e := range edges {
fmt.Printf("%d %d\n", e[0], e[1])
}
}
}
```