from bisect import bisect_right



N, D, A = list(map(int, input().split()))

X = [list(map(int, input().split())) for _ in range(N)]



x = []

h = []

for d, i in sorted(X):

    x.append(d)

    h.append(i)



ans = 0

k = [-(-v // A) for v in h]

y = [0] * (N + 2)

for i in range(N):

    y[i + 1] += y[i]

    s = max(0, k[i] - y[i + 1])

    ans += s

    y[i + 1] += s

    y[bisect_right(x, x[i] + 2 * D) + 1] -= s

    

print(ans)



from bisect import bisect_right



N, D, A = list(map(int, input().split()))

X = [list(map(int, input().split())) for _ in range(N)]



X.sort()

place = []

hps = []

for x, h in X:

    place.append(x)

    hps.append(h)



buf = [0] * (N + 2)

ans = 0

for i in range(N):

    # Update

    buf[i + 1] += buf[i]



    # Calc count

    tmp = -(-max(0, hps[i] - buf[i + 1] * A) // A)

    ans += tmp



    # Calc range

    j = bisect_right(place, place[i] + D * 2)

    buf[i + 1] += tmp

    buf[min(j + 1, N + 1)] -= tmp



print(ans)

from bisect import bisect_right

N, D, A = list(map(int, input().split()))
X = [list(map(int, input().split())) for _ in range(N)]
x = []
h = []
for d, i in sorted(X):
    x.append(d)
    h.append(i)
ans = 0
k = [-(-v // A) for v in h]
y = [0] * (N + 2)
for i in range(N):
    y[i + 1] += y[i]
    s = max(0, k[i] - y[i + 1])
    ans += s
    y[i + 1] += s
    y[bisect_right(x, x[i] + 2 * D) + 1] -= s
print(ans)

from bisect import bisect_right

N, D, A = list(map(int, input().split()))
X = [list(map(int, input().split())) for _ in range(N)]
X.sort()
place = []
hps = []
for x, h in X:
    place.append(x)
    hps.append(h)
buf = [0] * (N + 2)
ans = 0
for i in range(N):
    # Update
    buf[i + 1] += buf[i]
    # Calc count
    tmp = -(-max(0, hps[i] - buf[i + 1] * A) // A)
    ans += tmp
    # Calc range
    j = bisect_right(place, place[i] + D * 2)
    buf[i + 1] += tmp
    buf[min(j + 1, N + 1)] -= tmp
print(ans)

-x = [] -h = [] -for d, i in sorted(X): -    x.append(d) -    h.append(i) +X.sort() +place = [] +hps = [] +for x, h in X: +    place.append(x) +    hps.append(h) +buf = [0] * (N + 2) -k = [-(-v // A) for v in h] -y = [0] * (N + 2) -    y[i + 1] += y[i] -    s = max(0, k[i] - y[i + 1]) -    ans += s -    y[i + 1] += s -    y[bisect_right(x, x[i] + 2 * D) + 1] -= s +    # Update +    buf[i + 1] += buf[i] +    # Calc count +    tmp = -(-max(0, hps[i] - buf[i + 1] * A) // A) +    ans += tmp +    # Calc range +    j = bisect_right(place, place[i] + D * 2) +    buf[i + 1] += tmp +    buf[min(j + 1, N + 1)] -= tmp