Codeforces-SolutionsA/546A Soldier and Bananas/546A.cpp
2023-06-07 22:31:31 +06:00

15 lines
232 B
C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
int k,n,w;
cin>>k>>n>>w;
int i,money=0;
for(i=1;i<=w;i++)
{
money=money+i*k;
}
if(money>n) cout<<money-n<<endl;
else cout<<0<<endl;
}