main = do [l, r, n] <- map read . words <$> getLine putStr . unlines . map show $ solve l r n solve :: Int -> Int -> Int -> [Int] solve l r n | n == 1 = take n $ repeat 1 | otherwise = map ((+ (r - l + 1) `div` n) . f l r n) [1..n] f :: Int -> Int -> Int -> Int -> Int f l r n i = length $ filter (\j -> j `mod` n == i - 1) [l `mod` n .. r `mod` n]