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

pi=0

a=[]

abs_a=[]

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

    pi+=l+i-1



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

    a.append(l+i-1)



for i in range(n):

    abs_a.append(abs(a[i]))    



if max(a)<0:

    p=pi+min(abs_a)

else:

    p=pi-min(abs_a)

    

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

pi=0

a=[]

abs_a=[]

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

    pi+=l+i-1

    a.append(l+i-1)



for i in range(n):

    abs_a.append(abs(a[i]))    



if max(a)<0:

    p=pi+min(abs_a)

else:

    p=pi-min(abs_a)

    

print(p)
n, l = list(map(int, input().split()))
pi = 0
a = []
abs_a = []
for i in range(1, n + 1):
    pi += l + i - 1
for i in range(1, n + 1):
    a.append(l + i - 1)
for i in range(n):
    abs_a.append(abs(a[i]))
if max(a) < 0:
    p = pi + min(abs_a)
else:
    p = pi - min(abs_a)
print(p)

n, l = list(map(int, input().split()))
pi = 0
a = []
abs_a = []
for i in range(1, n + 1):
    pi += l + i - 1
    a.append(l + i - 1)
for i in range(n):
    abs_a.append(abs(a[i]))
if max(a) < 0:
    p = pi + min(abs_a)
else:
    p = pi - min(abs_a)
print(p)

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