There is chessboard which has N * M squares size of 1 * 1 and small squares can build up to a large one. Can you tell Mr. Guo that how many squares in the chessboard?
For Example, when N = 2 and M = 3, there are 6 squares size of 1 * 1 and 2 squares size of 2 * 2 in the chessboard, so the answer is 8.
Input
There are several lines in the input, each line consist of two positive integers N and M (1 <= N <= 100, 1 <= M <= 100) except the last line which N = 0 and M = 0 implying the end of the input and you should not process it.
Output
Please output the number of the squares for each chessboard in a single line.
Sample Input
1 1
2 3
3 3
0 0
Sample Output
1
8
14
posted on 2009-07-03 16:41
luis 阅读(216)
评论(0) 编辑 收藏 引用 所属分类:
规律