output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      H
      W
attempt: N, Q = list(map(int, input().split(" ")))
  A_list = list(map(int, input().split(" ")))
  
  
  def game(A_list, X, N):
      aoki_A_list = sorted(A_list, key=lambda val: abs(val - X))
  
      count = 0
      aoki_last_plus = None
      aoki_minus_plus = None
      aoki_last_minus = None
      while True:
          taka_val = A_list[-count - 1]
          aoki_val = aoki_A_list[count]
          aoki_view_val = aoki_val - X
  
          if aoki_view_val >= 0:
              aoki_last_plus = aoki_val
              now_plus = True
          else:
              now_plus = False
  
          # print(taka_val, aoki_val, aoki_last_plus, aoki_view_val)
  
          if aoki_last_plus is not None and aoki_last_plus >= taka_val:
              if not now_plus:
                  aoki_fail = False
              if now_plus:
                  if aoki_last_plus == taka_val:
                      aoki_fail = True
                  else:
                      aoki_fail = False
  
              break
  
          if aoki_view_val < 0:
              aoki_last_minus = aoki_val
  
          count += 1
  
      conflict_count = count
  
      first_sum = sum(aoki_A_list[:conflict_count])
      if aoki_last_minus is not None:
          aoki_minus_last_i = A_list.index(aoki_last_minus)
      else:
          if conflict_count >= 1:
              aoki_minus_last_i = A_list.index(aoki_A_list[0])
          else:
              aoki_minus_last_i = None
  
      last_i = aoki_minus_last_i
      if last_i is not None:
          if aoki_fail:
              if last_i >= 1:
                  if last_i % 2 == 1:
                      nokori_sum = sum(A_list[0:last_i:2])
                  else:
                      nokori_sum = sum(A_list[1:last_i:2])
  
              else:
                  nokori_sum = 0
          else:
              if last_i >= 2:
                  nokori_sum = sum(A_list[(last_i % 2) : last_i - 1 : 2])
              else:
                  nokori_sum = 0
  
          out = sum(A_list) - (first_sum + nokori_sum)
      else:
          if N % 2 == 1:
              out = sum(A_list[0::2])
          else:
              out = sum(A_list[1::2])
  
      return out
  
  
  for i in range(Q):
      X = int(input())
      out = game(A_list, X, N)
      print(out)
  
problem_description: Statement
  
  It has been decided that a programming contest sponsored by company A will be
  held, so we will post the notice on a bulletin board.
  
  The bulletin board is in the form of a grid with N rows and N columns, and the
  notice will occupy a rectangular region with H rows and W columns.
  
  How many ways are there to choose where to put the notice so that it
  completely covers exactly HW squares?
samples: [{"input": "3\n    2\n    3", "output": "2\n    \n\nThere are two ways to put the notice, as follows:\n\n    \n    \n    ###   ...\n    ###   ###\n    ...   ###\n    \n\nHere, `#` represents a square covered by the notice, and `.` represents a\nsquare not covered.\n\n* * *"}, {"input": "100\n    1\n    1", "output": "10000\n    \n\n* * *"}, {"input": "5\n    4\n    2", "output": "8"}]