#include #include #include #include #include #include #include #include #include #include #include #include typedef long long ll; using namespace std; #define mod 1000000009 #define INF 10000000 #define LLINF 2000000000000000000LL #define SIZE 10001 int main(){ int n,k; int s,b=0; int f = true; scanf("%d%d",&n,&k); int a = (n-1)%(k+1); while(1){ if(f && a==0){ cout << 0 << endl; }else{ cout << a << endl; a+=k+1; } scanf("%d",&b); f = false; if(b>=n) break; } return 0; }