Welcome to ZOJ
Information
Select Problem
Runs
Ranklist
ZOJ Problem Set - 3648
Gao the Grid II

Time Limit: 2 Seconds      Memory Limit: 65536 KB

A n * m grid as follow:

a n*m grid(n=4,m=3)

Count the number of acute triangles, three of whose vertice must be grid-points.
Note that the three vertice of a triangle must not be in a line.

Input

The input consists of several cases. Each case consists of two positive integers n and m (1 ≤ n, m ≤ 100).

Output

For each case, output the total number of acute triangle.

Sample Input

1 1
2 2

Sample Output

0
8

Author: WU, Yingxin
Submit    Status