80pts 求调
查看原帖
80pts 求调
1211668
WMY_楼主2024/10/1 09:28
#include <iostream>

using namespace std;

void input() {}
void input(auto&& x, auto&&... rest) {
	cin >> x;
	input(rest...);
}
void print() {}
void print(auto&& x, auto&&... rest) {
	cout << x;
    print(rest...);
}

#define int long long

int n, m;
int zfx, cfx;

signed main() {
	input(n, m);
	for (int i = 1; i <= n; i++) {
		cfx += i * (m * (m + 1) >> 1);
		zfx += i * (m - i) + (i * (i + 1) >> 1);
	}
	cfx -= zfx;
	print(zfx, " ", cfx, "\n");

    return 0;
}

2024/10/1 09:28
加载中...