#include using namespace std; int N,K,x,L,R,mij; int main() { cin >> N >> K; string response; L = 0; R = N; while(response != "exit") { mij = (L+R)/2; cout << "query " << mij << "\n"; cout.flush(); cin >> response; if (response == "broke") { K--; R = mij-1; } else { L = mij+1; } if (L == R) { cout << "answer" << L << '\n'; cout.flush(); cin >> response; } } }