Files
python/LuoGu/RuMen/P2241.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

16 lines
467 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include<iostream>
using namespace std;
long long n, m, rec, sqr;
int main() {
cin >> n >> m;
for (int i = 0; i < n; i++)//循环从n-0到n-(n-1)
for (int j = 0; j < m; j++) {//循环从m-0到m-(m-1)
if (i == j) sqr += (n - i) * (m - j);//如果i==j说明是正方形
else rec += (n - i) * (m - j);//如果不等说明是矩形
}
cout << sqr << " " << rec << endl;//输出
return 0;
}