import sys
input=sys.stdin.readline
#sys.stdout.flush()
#a=map(int,input().split())
t=int(input())
for _ in range(t):
    n=int(input())
    mi=1
    ma=n
    print('? '+str(n)+' '+str(n))
    sys.stdout.flush()
    ans=int(input())
    if ans==n:
        print('! '+str(n))
        continue
    while True:##이분 탐색
        mid=(ma+mi)//2
        print('? '+str(mid)+' '+str(ma))
        sys.stdout.flush()
        ans=set(map(int,input().split()))
        a=0
        for x in range(mid,ma+1):
            if x in ans:
                a+=1
        if a%2==0:###짝수라면 안에 정답 x
            ma=mid
        else:
            mi=mid
        if ma==mi:
            print('! '+str(ma))
            break
        if ma==mi+1:
            print('? '+str(ma)+' '+str(ma))
            sys.stdout.flush()
            ans=int(input())
            if ans==ma:
                print('! '+str(ma))
            else:
                print('! '+str(mi))
            break

이게 왜 안됨? 

쿼리마다 sys.stdout.flush()

이거 붙이면 끝 아니었음? 왜 뜨지 저거 돌아버리겠다 ㅠㅠ

https://codeforces.com/contest/1698/problem/D