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



l=[a+i-1 for i in range(1,n+1)]



import numpy as np

b=min(np.abs(l))



if b==0:

  l.remove(0)

elif b in l:

  l.remove(b)

elif -b in l:

  l.remove(-b)

  

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



apples=[a+i for i in range(n)]

eat=min(apples,key=lambda x:abs(x))

res=sum(apples)-eat



print(res)
n, a = list(map(int, input().split()))
l = [a + i - 1 for i in range(1, n + 1)]
import numpy as np

b = min(np.abs(l))
if b == 0:
    l.remove(0)
elif b in l:
    l.remove(b)
elif -b in l:
    l.remove(-b)
print((sum(l)))

n, a = list(map(int, input().split()))
apples = [a + i for i in range(n)]
eat = min(apples, key=lambda x: abs(x))
res = sum(apples) - eat
print(res)

-l = [a + i - 1 for i in range(1, n + 1)] -import numpy as np - -b = min(np.abs(l)) -if b == 0: -    l.remove(0) -elif b in l: -    l.remove(b) -elif -b in l: -    l.remove(-b) -print((sum(l))) +apples = [a + i for i in range(n)] +eat = min(apples, key=lambda x: abs(x)) +res = sum(apples) - eat +print(res)