#include <stdio.h>
int main()
{
unsigned long long int n, m, total, tmp;
while (scanf("%llu %llu", &m, &n) == 2 && m && n)
{
if (m < n) tmp = m, m = n, n = tmp;
total = m*(m-1)*n+n*(n-1)*m+(n*(n-1)*(2*n-1)/6-(n-1)*n/2)*4+2*n*(n-1)*(m-n+1);
printf("%llu\n", total);
}
return 0;
}
回目錄
回首頁
沒有留言 :
張貼留言