import sys readline = sys.stdin.readline write = sys.stdout.write flush = sys.stdout.flush # クエリ: "? x1 x2" を出力 def query(x1): write("? %d\n" % (x1)) flush() # ジャッジから返される値を取得 return int(readline()) # 回答: "! x" を出力 def answer(x1,x2): write("! %d %d\n" % (x1,x2)) flush() # 即時終了 exit(0) N = int(input()) if N<=20: L = [0]*N for i in range(1,N+1): l = query(i) L[i-1]=l for i in range(N): for j in range(i+2,N): if j-i>=N/2 and (j-i)%2==0 and L[j]-L[i]==(j-i)/2 and j-iN/2+1: answer(2,m) else: answer(m+1,N-1) if v+2==m/2: if m>N/2+2: answer(3,m) else: answer(m+1,N-2) else: if v-1==m/2: if m>N/2+1: answer(2,m) else: answer(m+1,N-1) if v-2==m/2: if m>N/2+2: answer(3,m) else: answer(m+1,N-2) return v>m/2 def meguru_bisect(ng, ok): while (abs(ok - ng) > 1): mid = (ok + ng) // 2 if is_ok(mid): ok = mid else: ng = mid return ok meguru_bisect(N,1)