You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
1011 B

2 years ago
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
/**
P1548
(=+)
1. -.
2.(i,j),i*j.
3..
*/
LL n, m, s1, s2;
int main() {
cin >> n >> m;
for (int i = 1; i <= n; i++)
for (int j = 1; j <= m; j++) {
s1 += min(i, j);//也可以理解为左上角
s2 += i * j; //也可以理解为左上角开始,也是一样的
}
cout << s1 << " " << s2 - s1 << endl;
return 0;
}