output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      W H K
attempt: W, H, K = list(map(int, input().split()))
  
  counter = int(0)
  triangle_counter = 0
  
  if W <= 2 or H == 1:
      print(0)
  else:
      for i in range(1, H):
          for j in range(1, W):
              for k in range(j, W):
                  counter = 0
                  if j == k:  # 三角形の1辺がy軸と垂直
                      for l in range(1, j):
                          counter += int(
                              (H - float(i)) / float(k) * l + float(i) / float(j) * l
                          )
                      if counter <= K:
                          triangle_counter += 2
                  else:  # j < k
                      for m in range(1, j):
                          counter += int(
                              (H - float(i)) / float(k) * m + float(i) / float(j) * m
                          )
                      for n in range(j, W):
                          counter += int(
                              (H - float(i)) / float(k) * n
                              + i
                              - H * n / (float(k) - float(j) - H * j / (1 + j))
                          )
                      if counter == K:
                          triangle_counter += 4
      print(triangle_counter)
  
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"}]