#include #include #include using namespace atcoder; using namespace std; #define rep(i,n) for(int i=0;i<(n);i++) #define Inf 1000000001 int main(){ int N,K; cin>>N>>K; int last = -1; while(true){ int nxt = last/(K+1); nxt *= K+1; nxt += (N-1) % (K+1); if(nxt<=last)nxt += K+1; cout<>ret; if(ret>=N){ return 0; } last = ret; } return 0; }