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
input=sys.stdin.readline 이거 지워
헉 진짜네 ㄷㄷ ㄱㅅㄱㅅ 근데 저번에 다른 인터랙티브 문제에서는 저렇게 해도 문제없었는데 이상하네
그리고 그냥 print('?',n,n) 이렇게하는게 더 편할것
어떤 사람 저렇게 하길래 저렇게만 해야하는줄 ㅋㅋ