题目传送门
代码:
#include <bits/stdc++.h>
#define int long long
using namespace std;
int t;
signed main () {
ios::sync_with_stdio(false);
cin.tie();
cout.tie();
cin >> t;
while (t--) {
int n, k, d;
cin >> n >> k >> d;
if (d % 2 == 0) {
cout << n * (n + 1) / 2 << endl;
} else {
int x = floor(n / 2);
int y = ceil(n / 2);
cout << x * (x + 1) / 2 + y * (y + 1) / 2 << endl;
}
}
return 0;
}
请大佬帮忙看看,哪里出错了