#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; int main() { ll n, k; scanf("%lld %lld", &n, &k); if (n-1 <= k) { printf("%lld\n", n-1); scanf("%lld", &n); return 0; } ll r = 0; if (n%(k+1) == 1) { puts("0"); scanf("%lld", &r); } ll p = (n-1)%(k+1); while (r < n) { printf("%lld\n", (r+k-p)/(k+1)*(k+1)+p); scanf("%lld", &r); } }