output_description: Print the minimum number of bombs needed to win.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N D A
      X_1 H_1
      :
      X_N H_N
attempt: def main():
      N, D, A = (int(i) for i in input().split())
      P = [[int(i) for i in input().split()] for j in range(N)]
      P.sort()
      X = [x[0] for x in P]
      H = [h[1] for h in P]
      diff = [H[0]] + [H[i + 1] - H[i] for i in range(N - 1)]
      BIT = [0] * (N + 1)
  
      def BIT_query(idx):
          """A1 ~ Aiまでの和(1-index)"""
          res_sum = 0
          while idx > 0:
              res_sum += BIT[idx]
              idx -= idx & -idx
          return res_sum
  
      def BIT_update(idx, x):
          """Aiにxを加算(1-index)"""
          while idx <= N:
              BIT[idx] += x
              idx += idx & -idx
          return
  
      def BIT_init(A):
          for i, e in enumerate(A):
              BIT_update(i + 1, e)
  
      BIT_init(diff)
      from bisect import bisect_right
  
      ans = 0
      for left in range(N):
          x = P[left][0]
          h = BIT_query(left + 1)
          cur = (h + A - 1) // A
          damage = cur * A
          BIT_update(left + 1, -damage)
          right = bisect_right(X, x + 2 * D)
          BIT_update(right + 1, damage)
          ans += cur
      print(ans)
  
  
  if __name__ == "__main__":
      main()
  
problem_description: Statement
  
  Silver Fox is fighting with N monsters.
  
  The monsters are standing in a row, and we can assume them to be standing on a
  number line. The i-th monster, standing at the coordinate X_i, has the
  _health_ of H_i.
  
  Silver Fox can use bombs to attack the monsters. Using a bomb at the
  coordinate x decreases the healths of all monsters between the coordinates x-D
  and x+D (inclusive) by A. There is no way other than bombs to decrease the
  monster's health.
  
  Silver Fox wins when all the monsters' healths become 0 or below.
  
  Find the minimum number of bombs needed to win.
samples: [{"input": "3 3 2\n    1 2\n    5 4\n    9 2", "output": "2\n    \n\nFirst, let us use a bomb at the coordinate 4 to decrease the first and second\nmonsters' health by 2.\n\nThen, use a bomb at the coordinate 6 to decrease the second and third\nmonsters' health by 2.\n\nNow, all the monsters' healths are 0. We cannot make all the monsters' health\ndrop to 0 or below with just one bomb.\n\n* * *"}, {"input": "9 4 1\n    1 5\n    2 4\n    3 3\n    4 2\n    5 1\n    6 2\n    7 3\n    8 4\n    9 5", "output": "5\n    \n\nWe should use five bombs at the coordinate 5.\n\n* * *"}, {"input": "3 0 1\n    300000000 1000000000\n    100000000 1000000000\n    200000000 1000000000", "output": "3000000000\n    \n\nWatch out for overflow."}]