Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@prkagrawal
Last active June 20, 2020 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prkagrawal/b345a1d4cda156d2e82bf5b1f1940261 to your computer and use it in GitHub Desktop.
Save prkagrawal/b345a1d4cda156d2e82bf5b1f1940261 to your computer and use it in GitHub Desktop.
#dailyCoding #python
k,n,w = str(input()).split()
k = int(k)
n = int(n)
w = int(w)
mn = 0
for i in range(w):
mn = mn + (i+1)*k
if n<mn:
print(mn-n)
else:
print(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment