package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	N, M, l, r := scan()
	stations := make([](map[int]struct{}), M+1) // 駅 i の名産品を格納
	answersSet := make([]map[int]struct{}, M+1)
	answers := make([]int, M+1) // 間隔 d のときの名産品の種類数

	for i := 0; i <= M; i++ {
		stations[i] = make(map[int]struct{})
		answersSet[i] = make(map[int]struct{})
	}

	for meisan := 0; meisan < N; meisan++ {
		for j := l[meisan]; j <= r[meisan]; j++ {
			// 駅 j には名産品 meisan がある
			stations[j][meisan] = struct{}{}
		}
	}

	for d := 1; d <= M; d++ {
		for pos := 0; pos <= M; pos += d {
			for meisan := range stations[pos] {
				answersSet[d][meisan] = struct{}{}
			}
		}
	}

	for d := 1; d <= M; d++ {
		answers[d] = len(answersSet[d])
	}

	for d := 1; d <= M; d++ {
		fmt.Println(answers[d])
	}
}


func scan() (int, int, []int, []int) {
	var N, M int
	sc.Scan()
	nm := strings.Split(sc.Text(), " ")
	N, _ = strconv.Atoi(nm[0])
	M, _ = strconv.Atoi(nm[1])
	l := make([]int, N)
	r := make([]int, N)
	for i := 0; i < N; i++ {
		sc.Scan()
		lr := strings.Split(sc.Text(), " ")
		l[i], _ = strconv.Atoi(lr[0])
		r[i], _ = strconv.Atoi(lr[1])
	}
	return N, M, l, r
}
