#include typedef long long ll; using namespace std; int INF = 1LL << 30; int MOD = 1e9+7; main(){ int N,K; cin >> N >> K; //N % (K+1) == 0なら先行 if(N % (K+1) == 0){ int num = 0; while(num < N){ cout << num / (K+1) * (K+1) + K << endl; fflush(0); cin >> num; } }else{ cout << 0 << endl; fflush(0); int num; cin >> num; while(num < N){ cout << (num + K) / (K+1) * (K+1) << endl; fflush(0); cin >> num; } } }