N, L = list(map(int, input().split()))



A = []

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

    A.append(L + i - 1)



cur_diff = float('inf') 

ans = float('inf')

Sum = sum(A)

for a in A:    

    tmp = Sum - a

    diff = abs(Sum - tmp)

    if diff < cur_diff:

        cur_diff = diff

        ans = tmp



print(ans)
N, L = list(map(int, input().split()))



sumA = 0

for i in range(N):

    sumA += (L + i)

    

cur_diff = float('inf')

ans = 0

for i in range(N):

    tmp = sumA - (L + i)

    diff = abs(sumA - tmp)

    if diff < cur_diff:

        cur_diff = diff

        ans = tmp

        

print(ans)
N, L = list(map(int, input().split()))
A = []
for i in range(1, N + 1):
    A.append(L + i - 1)
cur_diff = float("inf")
ans = float("inf")
Sum = sum(A)
for a in A:
    tmp = Sum - a
    diff = abs(Sum - tmp)
    if diff < cur_diff:
        cur_diff = diff
        ans = tmp
print(ans)

N, L = list(map(int, input().split()))
sumA = 0
for i in range(N):
    sumA += L + i
cur_diff = float("inf")
ans = 0
for i in range(N):
    tmp = sumA - (L + i)
    diff = abs(sumA - tmp)
    if diff < cur_diff:
        cur_diff = diff
        ans = tmp
print(ans)

-A = [] -for i in range(1, N + 1): -    A.append(L + i - 1) +sumA = 0 +for i in range(N): +    sumA += L + i -ans = float("inf") -Sum = sum(A) -for a in A: -    tmp = Sum - a -    diff = abs(Sum - tmp) +ans = 0 +for i in range(N): +    tmp = sumA - (L + i) +    diff = abs(sumA - tmp)