output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      W H K
attempt: import sys
  
  
  def count_h(y1, y2, w):
      n = y1 * (w + 1)
      if y2 == y1:
          n += w + 1
      else:
          n += int((y2 - y1 + 1) * (w + 1) / 2 + 1)
      return n - 2
  
  
  def count_xy(x, y):
      return int(((x + 1) * (y + 1) + 1) / 2) + 1 - 2
  
  
  def test_count():
      assert count_xy(1, 1) == 1
      assert count_xy(1, 2) == 2
      assert count_xy(2, 2) == 4
      assert count_h(0, 0, 3) == 2
      assert count_h(0, 1, 3) == 3
      assert count_h(0, 2, 3) == 5
      assert (3 * 4) - count_xy(1, 1) - count_xy(1, 1) - count_h(2, 2, 2) - 3 == 0
  
  
  def count_k(w, h, k):
      result = 0
      for x1 in range(1, w + 1):
          count = 0
          for y1 in range(1, h + 1):
              for y2 in range(y1, h + 1):
                  dot = (
                      (1 + w) * (1 + h)
                      - count_xy(x1, y1)
                      - count_xy(w - x1, y2)
                      - count_h(h - y1, h - y2, w)
                      - 3
                  )
                  if dot == k:
                      # print([x1, 0], [0, y1], [w, y2], "match")
                      count = count + 1 if y1 == y2 else count + 2
                  else:
                      # print([x1, 0], [0, y1], [w, y2], "not", dot)
                      assert dot >= 0
              for x2 in range(x1, w + 1):
                  dot = (
                      (1 + w) * (1 + h)
                      - count_xy(x1, y1)
                      - count_xy(x2, h - y2)
                      - count_h(w - x1, w - x2, h)
                      - 3
                  )
                  if dot == k:
                      # print([x1, 0], [0, y1], [w, y2], "match")
                      count = count + 1 if x1 == x2 else count + 2
                  else:
                      # print([x1, 0], [0, y1], [w, y2], "not", dot)
                      assert dot >= 0
          if w / 2 != x1:
              count *= 2
          result += count
      return result
  
  
  w, h, k = map(int, sys.stdin.readline().split())
  print(count_k(w, h, k))
  
problem_description: Statement
  
  In a two-dimensional plane, we have a rectangle R whose vertices are (0,0),
  (W,0), (0,H), and (W,H), where W and H are positive integers. Here, find the
  number of triangles \Delta in the plane that satisfy all of the following
  conditions:
  
    * Each vertex of \Delta is a grid point, that is, has integer x\- and y-coordinates.
    * \Delta and R shares no vertex.
    * Each vertex of \Delta lies on the perimeter of R, and all the vertices belong to different sides of R.
    * \Delta contains at most K grid points strictly within itself (excluding its perimeter and vertices).
samples: [{"input": "2 3 1", "output": "12\n    \n\nFor example, the triangle with the vertices (1,0), (0,2), and (2,2) contains\njust one grid point within itself and thus satisfies the condition.\n\n* * *"}, {"input": "5 4 5", "output": "132\n    \n\n* * *"}, {"input": "100 100 1000", "output": "461316"}]