← Home
```go
package main

import (
	"bufio"
	"fmt"
	"math/rand"
	"os"
	"time"
)

func main() {
	rand.Seed(time.Now().UnixNano())
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)

	readInt := func() int {
		if !scanner.Scan() {
			os.Exit(0)
		}
		var res int
		fmt.Sscanf(scanner.Text(), "%d", &res)
		return res
	}

	t := readInt()
	for tc := 0; tc < t; tc++ {
		n := readInt()
		if n == -1 {
			os.Exit(0)
		}

		if n == 1 {
			fmt.Println("! 1")
			continue
		}

		V := make([]int, n)
		for i := 0; i < n; i++ {
			V[i] = i + 1
		}

		for len(V) > 1 {
			A := make([]int, 0, n)
			B := make([]int, 0, n-1)

			perm := rand.Perm(2*n - 1)
			for i := 0; i < 2*n-1; i++ {
				if i < n {
					A = append(A, perm[i]+1)
				} else {
					B = append(B, perm[i]+1)
				}
			}

			rand.Shuffle(len(V), func(i, j int) { V[i], V[j] = V[j], V[i] })

			nextV := make([]int, 0)
			for i, x := range V {
				if len(nextV)+len(V)-i == 1 {
					nextV = append(nextV, x)
					break
				}

				fmt.Printf("? %d %d", x, len(A))
				for _, pos := range A {
					fmt.Printf(" %d", pos)
				}
				fmt.Println()

				ans1 := readInt()
				if ans1 == -1 {
					os.Exit(0)
				}

				if ans1 == 1 {
					fmt.Printf("? %d %d", x, len(B))
					for _, pos := range B {
						fmt.Printf(" %d", pos)
					}
					fmt.Println()

					ans2 := readInt()
					if ans2 == -1 {
						os.Exit(0)
					}

					if ans2 == 0 {
						nextV = append(nextV, x)
					}
				} else {
					nextV = append(nextV, x)
				}
			}
			V = nextV
		}

		fmt.Printf("! %d\n", V[0])
	}
}
```