import numpy as np



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

li=[]

for i in range(n):

  li.append(l+i)

s=sum(li)

p=np.array(li)

a=np.abs(p).tolist()

k=min(a)

b=a.index(k)

print((s-li[b]))
n,l=list(map(int,input().split()))

a=0

for i in range(n):

  a+=i+l

if l>=0:

  print((a-l))

elif l+n-1<0:

  print((a-(l+n-1)))

else:

  print(a)
import numpy as np

n, l = list(map(int, input().split()))
li = []
for i in range(n):
    li.append(l + i)
s = sum(li)
p = np.array(li)
a = np.abs(p).tolist()
k = min(a)
b = a.index(k)
print((s - li[b]))

n, l = list(map(int, input().split()))
a = 0
for i in range(n):
    a += i + l
if l >= 0:
    print((a - l))
elif l + n - 1 < 0:
    print((a - (l + n - 1)))
else:
    print(a)

-import numpy as np - -li = [] +a = 0 -    li.append(l + i) -s = sum(li) -p = np.array(li) -a = np.abs(p).tolist() -k = min(a) -b = a.index(k) -print((s - li[b])) +    a += i + l +if l >= 0: +    print((a - l)) +elif l + n - 1 < 0: +    print((a - (l + n - 1))) +else: +    print(a)