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

sa = 1000

sum = 0

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

    if sa != min(abs(l+i-1), sa):

        sa = min(abs(l+i-1), sa)

        app = l+i-1

    sum += l+i-1



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



ans=0

min_a=10**9

for i in range(n):

  ans+=l+i

  if abs(min_a)>abs(l+i):

    min_a=l+i

print((ans-min_a))
n, l = list(map(int, input().split()))
sa = 1000
sum = 0
for i in range(1, n + 1):
    if sa != min(abs(l + i - 1), sa):
        sa = min(abs(l + i - 1), sa)
        app = l + i - 1
    sum += l + i - 1
print((sum - app))

n, l = list(map(int, input().split()))
ans = 0
min_a = 10**9
for i in range(n):
    ans += l + i
    if abs(min_a) > abs(l + i):
        min_a = l + i
print((ans - min_a))

-sa = 1000 -sum = 0 -for i in range(1, n + 1): -    if sa != min(abs(l + i - 1), sa): -        sa = min(abs(l + i - 1), sa) -        app = l + i - 1 -    sum += l + i - 1 -print((sum - app)) +ans = 0 +min_a = 10**9 +for i in range(n): +    ans += l + i +    if abs(min_a) > abs(l + i): +        min_a = l + i +print((ans - min_a))