A soldier wants to buy w bananas in the shop. He has to pay k dollars for the first banana, 2k dollars for the second one and so on (in other words, he has to pay i·k dollars for the i-th banana). 

He has n dollars. How many dollars does he have to borrow from his friend soldier to buy w bananas?


-----Input-----

The first line contains three positive integers k, n, w (1  ≤  k, w  ≤  1000, 0 ≤ n ≤ 10^9), the cost of the first banana, initial number of dollars the soldier has and number of bananas he wants. 


-----Output-----

Output one integer — the amount of dollars that the soldier must borrow from his friend. If he doesn't have to borrow money, output 0.


-----Examples-----
Input
3 17 4

Output
13

Difficulty: interview

Starter code:

Solutions:
k,n,w = map(int,input().split())

x = (w)*(w+1)//2 * k

y = x - n

if(y >= 0):
	print(y)
else:
	print(0)

import math

k, n, w = map(int, input().split(' '))
total = 0
for i in range(w):
    total+=(i+1)*k

if total <= n:
    print(0)
else:
    print(total - n)

k, n, w = list(map(int, input().split()))
print(max(sum(k*(i+1) for i in range(w)) - n , 0))


k, n, w = list(map(int, input().split()))
print(max(0, (w * (w + 1) // 2) * k - n))


k,n,w = list(map(int, input().split()))
s = (w*(w+1))//2
print(max(0, s*k-n))


k, n, w = map(int, input().split())

s = w * (k + w * k) // 2
r = max(s - n, 0)
print(r)

k, w, n = [int(i) for i in input().split()]
t = k*n*(n+1)//2-w
if t>0:
    print(t)
else:
    print(0)


k, n, w = list(map(int, input().split()))
print(max(0, k * (w * (w + 1) // 2) - n))



import math
import sys

inp=list(map(int,input().split()))
k=inp[0]
n=inp[1]
w=inp[2]

m=k*(round((w*w+w)/2))
if m-n < 0:
    print(0)
else:  
    print(m-n)


#!/usr/bin/env python3
k, n, w = list(map(int,input().split()))
print(max(0,int(w*(w+1)/2*k-n)))


__author__ = 'Andrey'
k, n, w = map(int, input().split())
needed = w * (w + 1) // 2 * k
if needed <= n:
    print(0)
else:
    print(needed - n)

k, n, w = map(int, input().split())
sum1 = k * (w * (w + 1)) // 2
print(max(0, sum1 - n))

import sys


def main():
	k, n, w = map(int, sys.stdin.readline().split())
	s = k * (1 + w) * w // 2
	print (max(s - n, 0))

def __starting_point():
	main()
__starting_point()

k, n, w = map(int, input().split())
sw = w * (w + 1) / 2 * k
print(int(0) if n > sw else int(sw - n))

k, n, w = map(int, input().split())
print(int(max(k * (((2 * 1 + w - 1) * w) / 2) - n, 0)))

def __starting_point():
    k, n, w = map(int, input().split())
    price = (w + 1) * w * k // 2
    print(max(0, price - n))
__starting_point()

k,n,w = (int(x) for x in input().split())
s = (k + w * k) * w // 2
res = max(0, s - n)
print(res)


import sys


k, n, w = map(int, input().split(" "))
if(k*(w)*(w+1)/2 < n): 
    print(0)
    return
print(int(k*(w)*(w+1)/2-n))

k, n, w = list(map(int, input().split()))
res = 0
for i in range(1, w + 1):
    res += i * k
if (n < res):
    print(res - n)
else:
    print(0)

k, n, w = map(int, input().split())
print(max(0, (k * w * (w + 1) // 2) - n))

#!/usr/bin/env python3

K, N, W = input().split(' ')
K = int(K)
N = int(N)
W = int(W)
cost = int(K * W * (W + 1) / 2)

if cost > N:
    print(cost - N)
else:
    print(0)

n, k, m = [int(x) for x in input().split()]
s = ((n + m * n) * m) // 2
print(max(0, s - k))


k, n, w=map(int, input().split())
s = n - k*w*(w+1)//2
#print(s, k, n, w)
if s <0:
    print(-s)
else:
    print(0)

# coding:utf-8

k,n,w = list(map(int, input().split(' ')))
tc = k*w*(w+1)//2
if n - tc < 0:
    print(tc - n)
else:
    print(0)


#!/usr/bin/env python
# -.- coding: utf-8 -.-

k, n, w = (int(item) for item in input().strip().split(" "))
acc = 0
i = 1
totals = (k*w+1*k)*w // 2
print((0, totals - n)[(totals - n)>0])