Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include<iostream>
using namespace std;
int main(){
int k, n, w;
cin>>k;
cin>>n;
cin>>w;
int sum = 0;
for(int i = 1; i <i= w; i++){
sum += i*k;
}
int b = (sum - n) > 0 ? (sum - n) : 0;
cout<i<ib;
return 0;
}
Copy The Code &
Try With Live Editor
Input
3 17 4
Output
13
Demonstration
Codeforcess Solution 546-A A. Soldier and Bananas ,C++, Java, Js and Python ,546-A,Codeforcess Solution