1200 - How many squares

Time Limit: 1s Memory Limit: 128MB

Submissions: 948 Solved: 336
Description
You are give a grid of N*M(1< N, M <1000). And your job is to calculate how many different squares can be found in this gird.
Input
For each test case, given a line of 2 integers, N and M.
Output
One integer in a line, the number of squares can be found.
Sample Input
3 3
Sample Output
14
Hint
Source
Liruqi