from bisect import bisect_right



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

M = []

for i in range(N):

  x, h = list(map(int, input().split()))

  M.append((x, -(-h//A)))

M.sort(key=lambda x: x[0])

X = list([x[0] for x in M])

H = list([x[1] for x in M])



dmg = [0] * (N+1)

ans = 0



for i in range(N):

  x, h = M[i]

  h = max(0, h - dmg[i])

  dmg[i] += h

  dmg[bisect_right(X, x + 2*D)] -= h

  dmg[i+1] += dmg[i]

  ans += h

print(ans)
from bisect import bisect_right



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

M = []

for i in range(N):

  x, h = list(map(int, input().split()))

  M.append((x, -(-h//A)))

M.sort(key=lambda x: x[0])

X = list([x[0] for x in M])

H = list([x[1] for x in M])



dmg = [0] * (N+1)

ans = 0



for i in range(N):

  x, h = M[i]

  h = max(0, h - dmg[i])

  dmg[bisect_right(X, x + 2*D)] -= h

  dmg[i+1] += dmg[i] + h

  ans += h

print(ans)
from bisect import bisect_right

N, D, A = list(map(int, input().split()))
M = []
for i in range(N):
    x, h = list(map(int, input().split()))
    M.append((x, -(-h // A)))
M.sort(key=lambda x: x[0])
X = list([x[0] for x in M])
H = list([x[1] for x in M])
dmg = [0] * (N + 1)
ans = 0
for i in range(N):
    x, h = M[i]
    h = max(0, h - dmg[i])
    dmg[i] += h
    dmg[bisect_right(X, x + 2 * D)] -= h
    dmg[i + 1] += dmg[i]
    ans += h
print(ans)

from bisect import bisect_right

N, D, A = list(map(int, input().split()))
M = []
for i in range(N):
    x, h = list(map(int, input().split()))
    M.append((x, -(-h // A)))
M.sort(key=lambda x: x[0])
X = list([x[0] for x in M])
H = list([x[1] for x in M])
dmg = [0] * (N + 1)
ans = 0
for i in range(N):
    x, h = M[i]
    h = max(0, h - dmg[i])
    dmg[bisect_right(X, x + 2 * D)] -= h
    dmg[i + 1] += dmg[i] + h
    ans += h
print(ans)

-    dmg[i] += h -    dmg[i + 1] += dmg[i] +    dmg[i + 1] += dmg[i] + h