Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n,c=map(int,raw_input().split())
- import sys
- low=1
- high=n
- Purse=1000
- while True:
- mid=int(((low*3.5)+high)/4.5)
- print 1,mid
- Purse-=1
- #print "Balance : ",Purse
- sys.stdout.flush()
- result=input()
- if result==1:
- Purse=Purse-c
- print 2
- sys.stdout.flush()
- high=mid-1
- elif result==0:
- low=mid+1
- if high-low+c<Purse:
- #print "\n\nLinear\n\n"
- break
- #print low,high,Purse
- for i in range(low,high+1):
- print 1,i
- sys.stdout.flush()
- result=input()
- if result==1:
- print 2
- sys.stdout.flush()
- print 3,i
- sys.stdout.flush()
- break
Add Comment
Please, Sign In to add comment