标签:style blog http color os io
#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
long long n, m;
int main() {
while (~scanf("%lld%lld", &n, &m) && n || m) {
if (n > m) swap(n, m);
printf("%lld\n", n * m * (n + m - 2) + 2 * n * (n - 1) * (3 * m - n - 1) / 3);
}
return 0;
}UVA 11538 - Chess Queen(数论+计数问题),码迷,mamicode.com
UVA 11538 - Chess Queen(数论+计数问题)
标签:style blog http color os io
原文地址:http://blog.csdn.net/accelerator_/article/details/24707471