def count1Rmod(r,n,k) return 0 if r <= 0 m,d = (r - 1).divmod(n) (k-1)%n <= d ? m + 1 : m end L,R,N = gets.split.map(&:to_i) puts N.times.map{|k| count1Rmod(R,N,k) - count1Rmod(L-1,N,k) }