program main implicit none integer*8::N,i integer*8::lower=1,mid,upper=10**9 do i=1,101 mid = (lower+upper)/2_8 print '("? ",i0)',mid read *,N if(N.eq.1) then lower=mid else upper=mid end if if(upper.le.lower+1) exit end do print '("! ",i0)',lower end program main