#include #include #include #include using namespace std; //namaega184 int main(){ int n,k;scanf("%d%d",&n,&k); int now=0,d=n%(k+2); int dis=(now-d+k+2)%(k+2); if(dis)now+=k+1-dis; printf("%d\n",now); fflush(stdout); while(1){ int ret;scanf("%d",&ret); if(ret>=n)break; now+=ret; dis=(now-d+k+2)%(k+2); now+=k+1-dis; printf("%d\n",now); fflush(stdout); } return 0; }