思路:水。
#include<stdio.h>
#include<math.h>int main()
{
int k,n,w,i,t;//k danjia n qian w geshu
scanf("%d%d%d",&k,&n,&w);
for(i=1;i<=w;i++)
{
t=i*k;
n-=t;
}
if(n<0) printf("%d\n",-n);
else printf("0\n");
return 0;
}
思路:水。
#include<stdio.h>
#include<math.h>