n,l=list(map(int,input().split()))

import copy

apple_l=[]



pie=0

deli=[]

for i in range(1,n+1):

  pie+=l+i-1

  deli.append(l+i-1)

ans={}

ans2=[]

for j in range(1,n+1):

  deli2=copy.copy(deli)

  deli2.remove(l+j-1)

  ans[abs(sum(deli2)-pie)]=sum(deli2)

  ans2.append(abs(sum(deli2)-pie))

print((ans[min(ans2)]))



n,l=list(map(int,input().split()))



mngap=[1,abs(l+1-1)]

for i in range(2,n+1):

  if mngap[1]>abs(l+i-1):

    mngap=[i,abs(l+i-1)]



total=0

for i in range(1,n+1):

  total+=l+i-1

print((total-(l+mngap[0]-1)))
n, l = list(map(int, input().split()))
import copy

apple_l = []
pie = 0
deli = []
for i in range(1, n + 1):
    pie += l + i - 1
    deli.append(l + i - 1)
ans = {}
ans2 = []
for j in range(1, n + 1):
    deli2 = copy.copy(deli)
    deli2.remove(l + j - 1)
    ans[abs(sum(deli2) - pie)] = sum(deli2)
    ans2.append(abs(sum(deli2) - pie))
print((ans[min(ans2)]))

n, l = list(map(int, input().split()))
mngap = [1, abs(l + 1 - 1)]
for i in range(2, n + 1):
    if mngap[1] > abs(l + i - 1):
        mngap = [i, abs(l + i - 1)]
total = 0
for i in range(1, n + 1):
    total += l + i - 1
print((total - (l + mngap[0] - 1)))

-import copy - -apple_l = [] -pie = 0 -deli = [] +mngap = [1, abs(l + 1 - 1)] +for i in range(2, n + 1): +    if mngap[1] > abs(l + i - 1): +        mngap = [i, abs(l + i - 1)] +total = 0 -    pie += l + i - 1 -    deli.append(l + i - 1) -ans = {} -ans2 = [] -for j in range(1, n + 1): -    deli2 = copy.copy(deli) -    deli2.remove(l + j - 1) -    ans[abs(sum(deli2) - pie)] = sum(deli2) -    ans2.append(abs(sum(deli2) - pie)) -print((ans[min(ans2)])) +    total += l + i - 1 +print((total - (l + mngap[0] - 1)))