/* -*- coding: utf-8 -*- * * 257.cc: No.257 N言っちゃダメゲーム (3) - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ /* typedef */ /* global variables */ /* subroutines */ /* main */ int main() { int n, k; cin >> n >> k; int c = 0; for (;;) { int a = (c + k) / (k + 1) * (k + 1); printf("%d\n", a); flush(cout); int b; cin >> b; if (b >= n) break; c = b; } return 0; }