n,m = gets.split.map &:to_i
h = {}
ans = {}
(1..m).each do |e|
    h[e] = []
    ans[e] = []
end
n.times do |i|
    l,r = gets.split.map &:to_i
    (l..r).each do |e|
        h[e] << i+1
    end
end
h.each do |k,v|
    ans[1].concat(v)
    (1..Math.sqrt(k).to_i).select do |i|
      k%i == 0
    end.map do |e|
        [e, k/e]
    end.flatten.uniq.each do |e|
        ans[e].concat(v) 
    end
end
ans.each_value do |e|
    p e.uniq.count
end