A n * m grid as follow:
a n*m grid(n=4,m=3)
Count the number of triangles, three of whose vertice must be grid-points.
Note that the three vertice of the triangle must not be in a line(the right picture is not a triangle).
a triangle not a triangle
Input
The input consists of several cases. Each case consists of two positive integers n and m (1 ≤ n, m ≤ 1000).
Output
For each case, output the total number of triangle.
Sample Input
1 1
2 2
Sample Output
4
76
http://blog.csdn.net/u014737310/article/details/40659573
http://www.cnblogs.com/kuangbin/archive/2012/09/30/2709436.html