#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define dbug(x) (void)(cerr << #x " = " << x << endl)
int main(){
ios::sync_with_stdio(false);
cin.tie(0),cout.tie(0);
ll t;
cin >> t;
while(t--){
ll n,k,d;
ll sum = 0;
cin >> n >> k >> d;
if(d % 2 == 0){
sum = (1 + n) * n / 2;
}else{
if(n % 2 == 0){
sum = n * (n / 2) / 2;
}else{
sum = (n+1) * (n / 2 + 1) / 2;
}
}
cout << sum << endl;
}
return 0;
}
被注释的方案一AC但TLE
未被注释的的方案二全WA
难道这两个代码不都是求奇数和嘛?
玄关求助!!!!