Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
273 B
0
Indexable
Never
#include <iostream>
using namespace std;
int main() {
	int k;
	int n;
	int w;
	cin >> k >> n >> w;
	int L = 0;
	int M = 0;
	int K = 0;
	for (int i = 1; i < w+1; i++) {
		L = k * i;
		n = n - L;
	}
	if (n < 0) {
		cout << -n;
	}
	else {
		cout << 0;
	}
}
Leave a Comment