Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cmath>
- #include <iostream>
- using namespace std;
- int main()
- {
- int k, n, w, sum=0, answ;
- cin >> k >> n >> w;
- for(int i=1;i<w+1;i++)
- {
- sum+=i*k;
- }
- if(sum>n){cout << abs(n-sum);}
- else{cout<<"0";}
- return 0;
- }
Add Comment
Please, Sign In to add comment