program main implicit none integer::N,K,a,b read *,N,K b = MOD(N-1,K+1) print '(i0)', b do read *,a if(a.ge.N) exit b = b + K + 1 print '(i0)',b end do end program main