// yukicoder: 257 N言っちゃダメゲーム (3) // 2019.9.5 bal4u #include #include int N; void out(int x) { printf("%d\n", x), fflush(stdout); } void in() { int you; scanf("%d", &you); if (you >= N) exit(0); } int main() { int p, K, first; scanf("%d%d", &N, &K); if ((N-1)%(K+1) == 0) out(0), first = 0, p = 0; else out(1), first = 1, p = 1; while (1) in(), p += K+1, out(p); return 0; }