from sys import stdin
read = lambda : map(int, stdin.readline().split())
n, m = read()
axis = []
for i in range(n):
    l, r = read()
    axis.append((l, -1, i))
    axis.append((r, 1, -i))
for i, d in enumerate(read()):
    axis.append((d, 0, i))
axis.sort()
hits = [0] * m
depth = 0
for x, dec, i in axis:
    depth -= dec
    if not dec:
        hits[i] = depth
print(*hits)

694fdf628bcc105bc1f22ad439290aae39c02b02
<mask token>

<mask token>
for i in range(n):
    l, r = read()
    axis.append((l, -1, i))
    axis.append((r, 1, -i))
for i, d in enumerate(read()):
    axis.append((d, 0, i))
axis.sort()
<mask token>
for x, dec, i in axis:
    depth -= dec
    if not dec:
        hits[i] = depth
print(*hits)

<mask token>
read = lambda : map(int, stdin.readline().split())
n, m = read()
axis = []
for i in range(n):
    l, r = read()
    axis.append((l, -1, i))
    axis.append((r, 1, -i))
for i, d in enumerate(read()):
    axis.append((d, 0, i))
axis.sort()
hits = [0] * m
depth = 0
for x, dec, i in axis:
    depth -= dec
    if not dec:
        hits[i] = depth
print(*hits)

from sys import stdin
read = lambda : map(int, stdin.readline().split())
n, m = read()
axis = []
for i in range(n):
    l, r = read()
    axis.append((l, -1, i))
    axis.append((r, 1, -i))
for i, d in enumerate(read()):
    axis.append((d, 0, i))
axis.sort()
hits = [0] * m
depth = 0
for x, dec, i in axis:
    depth -= dec
    if not dec:
        hits[i] = depth
print(*hits)
