Score : 1000 points
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:
Input is given from Standard Input in the following format:
W H K
Print the answer.
2 3 1
12
For example, the triangle with the vertices (1,0), (0,2), and (2,2) contains just one grid point within itself and thus satisfies the condition.
5 4 5
132
100 100 1000
461316