#include #include using namespace std; int n , k; char rasp[50]; int cb() { int st = 1; int dr = n; int sol = 0; for (int mij = (st + dr) >> 1; st <= dr; mij = (st + dr) >> 1) { cout << "query " << mij << '\n'; cout.flush(); cin >> rasp; if (strcmp(rasp , "broke") == 0) dr = mij - 1; else if (strcmp(rasp , "survived") == 0) st = mij + 1; else sol = mij; } if (!sol) sol = dr; return sol; } int main() { cin >> n >> k; cout << "answer " << cb() << '\n'; cout.flush(); cin >> rasp; return 0; }