#include int main() { int n, k; std::cin >> n >> k; int state = (n - 1) % (k + 1); while (state < n) { std::cout << state << std::endl; int a; std::cin >> a; state = (k + 1) * (a / (k + 1) + 1); } return 0; }