from collections import deque

import sys

input = sys.stdin.readline





n, d, a = list(map(int, input().split()))

monsters = []

for _ in range(n):

    pos, hp = list(map(int, input().split()))

    monsters.append([pos, hp])



monsters.sort()



bomb_area = deque([])

bomb_power = deque([])

total_damage = 0

ans = 0

for pos, hp in monsters:

    while bomb_area:

        area = bomb_area[0]

        if area < pos:

            bomb_area.popleft()

            power = bomb_power.popleft()

            total_damage -= power

        else:

            break

    if hp <= total_damage:

        continue

    else:

        count = (hp-total_damage + a-1) // a

        ans += count

        power = a * count

        total_damage += power

        bomb_area.append(pos+2*d)

        bomb_power.append(power)



print(ans)
def main():

    import sys

    from operator import itemgetter

    from collections import deque

    buf = sys.stdin.buffer

    

    n, d, a = list(map(int, buf.readline().split()))

    m = list(map(int, buf.read().split()))

    monsters = sorted(zip(m, m), key=itemgetter(0))

    

    bomb_area = deque([])

    bomb_power = deque([])

    total_damage = 0

    ans = 0

    for pos, hp in monsters:

        while bomb_area:

            area = bomb_area[0]

            if area < pos:

                bomb_area.popleft()

                power = bomb_power.popleft()

                total_damage -= power

            else:

                break

        if hp <= total_damage:

            continue

        else:

            count = (hp - total_damage + a - 1) // a

            ans += count

            power = a * count

            total_damage += power

            bomb_area.append(pos + 2 * d)

            bomb_power.append(power)

    print(ans)





if __name__ == '__main__':

    main()

from collections import deque
import sys

input = sys.stdin.readline
n, d, a = list(map(int, input().split()))
monsters = []
for _ in range(n):
    pos, hp = list(map(int, input().split()))
    monsters.append([pos, hp])
monsters.sort()
bomb_area = deque([])
bomb_power = deque([])
total_damage = 0
ans = 0
for pos, hp in monsters:
    while bomb_area:
        area = bomb_area[0]
        if area < pos:
            bomb_area.popleft()
            power = bomb_power.popleft()
            total_damage -= power
        else:
            break
    if hp <= total_damage:
        continue
    else:
        count = (hp - total_damage + a - 1) // a
        ans += count
        power = a * count
        total_damage += power
        bomb_area.append(pos + 2 * d)
        bomb_power.append(power)
print(ans)

def main():
    import sys
    from operator import itemgetter
    from collections import deque

    buf = sys.stdin.buffer
    n, d, a = list(map(int, buf.readline().split()))
    m = list(map(int, buf.read().split()))
    monsters = sorted(zip(m, m), key=itemgetter(0))
    bomb_area = deque([])
    bomb_power = deque([])
    total_damage = 0
    ans = 0
    for pos, hp in monsters:
        while bomb_area:
            area = bomb_area[0]
            if area < pos:
                bomb_area.popleft()
                power = bomb_power.popleft()
                total_damage -= power
            else:
                break
        if hp <= total_damage:
            continue
        else:
            count = (hp - total_damage + a - 1) // a
            ans += count
            power = a * count
            total_damage += power
            bomb_area.append(pos + 2 * d)
            bomb_power.append(power)
    print(ans)


if __name__ == "__main__":
    main()

-from collections import deque -import sys +def main(): +    import sys +    from operator import itemgetter +    from collections import deque -input = sys.stdin.readline -n, d, a = list(map(int, input().split())) -monsters = [] -for _ in range(n): -    pos, hp = list(map(int, input().split())) -    monsters.append([pos, hp]) -monsters.sort() -bomb_area = deque([]) -bomb_power = deque([]) -total_damage = 0 -ans = 0 -for pos, hp in monsters: -    while bomb_area: -        area = bomb_area[0] -        if area < pos: -            bomb_area.popleft() -            power = bomb_power.popleft() -            total_damage -= power +    buf = sys.stdin.buffer +    n, d, a = list(map(int, buf.readline().split())) +    m = list(map(int, buf.read().split())) +    monsters = sorted(zip(m, m), key=itemgetter(0)) +    bomb_area = deque([]) +    bomb_power = deque([]) +    total_damage = 0 +    ans = 0 +    for pos, hp in monsters: +        while bomb_area: +            area = bomb_area[0] +            if area < pos: +                bomb_area.popleft() +                power = bomb_power.popleft() +                total_damage -= power +            else: +                break +        if hp <= total_damage: +            continue -            break -    if hp <= total_damage: -        continue -    else: -        count = (hp - total_damage + a - 1) // a -        ans += count -        power = a * count -        total_damage += power -        bomb_area.append(pos + 2 * d) -        bomb_power.append(power) -print(ans) +            count = (hp - total_damage + a - 1) // a +            ans += count +            power = a * count +            total_damage += power +            bomb_area.append(pos + 2 * d) +            bomb_power.append(power) +    print(ans) + + +if __name__ == "__main__": +    main()