Created
August 6, 2018 11:34
-
-
Save sahasourav17/d05e1789bb3eade3b22b07aad9a3abab to your computer and use it in GitHub Desktop.
codeforces 546A solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main() | |
{ | |
int n , k ,w; | |
int i ,sum = 0; | |
int dollar; | |
scanf("%d %d %d",&k,&n,&w); | |
for(i = 1;i <= w;i++) | |
{ | |
sum = sum + i*k; | |
} | |
dollar = sum - n; | |
if(dollar > 0) | |
{ | |
printf("%d\n",dollar); | |
} | |
else | |
printf("0\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment