洛谷CF1539A Contest Start
这题刚一看就需要找规律,想一想就能想到其中规律,具体详见文末题解
题解:
#include <bits/stdc++.h>
#define int long long
using namespace std;
inline int read()
{
int s=0,w=1;
char ch=getchar();
while(ch<'0'||ch>'9') { if(ch=='-') w*=-1; ch=getchar(); }
while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
return s*w;
}
int k,n,x,t;
signed main()
{
k=read();
while(k--){
n=read(),x=read(),t=read();
int temp=min(t/x,n-1);
int ans=(n-temp)*temp;
temp--;
ans+=(1+temp)*temp/2;
printf("%lld\n",ans);
}
return 0;
}