N, M = [int(n) for n in input().split()]


souvenir_range = []
for i in range(N):
    l, r = [int(n) for n in input().split()]
    souvenir_range.append(list(range(l, r+1)))
print(souvenir_range)


stop_list_each_train = []
for i in range(1, M+1):
    stop_list_each_train.append(list(set([(i*m) % (M+1) for m in range(M+1) if i*m <= M])))
print(stop_list_each_train)

for stop_list in stop_list_each_train:
    counter = 0
    for souvenir in souvenir_range:
        for stop in stop_list:
            if stop in souvenir:
                counter += 1
                break
    print(counter)