import Control.Monad (replicateM)
import Data.List (foldl')
import qualified Data.IntMap as M
import qualified Data.IntSet as S

main = do
    [n,m] <- getInts
    ranges <- replicateM n $ do
        [l,r] <- getInts
        return (l,r)
    let ds = [1..m]
        table = mkTable ds $ zip [1..] ranges
    mapM_ (print . solve table) ds

getInts :: IO [Int]
getInts = map read . words <$> getLine

mkTable :: [Int] -> [(Int,(Int,Int))] -> M.IntMap S.IntSet
mkTable ms rs = foldl' build M.empty ms
    where build acc m =
              let s = S.fromList $ map fst
                            $ filter (\(_,(l,r)) -> l <= m && m <= r) rs
               in M.insert m s acc

solve :: M.IntMap S.IntSet -> Int -> Int
solve t d = S.size $ M.foldlWithKey' (\acc k s -> if k `mod` d == 0 then S.union acc s else acc) S.empty t
