Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
234 B
1
Indexable
Never

#include <iostream>

using namespace std;
int main()
{
	int k, w, n, b = 0,i=1;
	cin >> k >> n >> w;
	while(w){
		b+= k * i;
		i++; w--;
		}
	if (n >= b) {
		cout << '0';
	}
	else 
	cout << (n - b) * -1;
	
    
}
Leave a Comment