import copy



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



apple_taste = [L+i for i in range(N)]



pie_taste = sum(apple_taste)



min_diff = 100000

for i in range(N):

    ap = copy.deepcopy(apple_taste)

    ap[i] = 0



    pie_taste2 = sum(ap)

    diff = abs(pie_taste - pie_taste2)



    if diff < min_diff:

        min_diff = diff

        min_index = i





apple_taste[min_index] = 0



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



pie = 0

min_abs = 10000

min_abs_apple = None

for i in range(N):

    if min_abs > abs(i + L):

        min_abs = abs(i + L)

        min_abs_apple = i + L

    pie += i + L



print((pie - min_abs_apple))
import copy

N, L = list(map(int, input().split()))
apple_taste = [L + i for i in range(N)]
pie_taste = sum(apple_taste)
min_diff = 100000
for i in range(N):
    ap = copy.deepcopy(apple_taste)
    ap[i] = 0
    pie_taste2 = sum(ap)
    diff = abs(pie_taste - pie_taste2)
    if diff < min_diff:
        min_diff = diff
        min_index = i
apple_taste[min_index] = 0
print((sum(apple_taste)))

N, L = list(map(int, input().split()))
pie = 0
min_abs = 10000
min_abs_apple = None
for i in range(N):
    if min_abs > abs(i + L):
        min_abs = abs(i + L)
        min_abs_apple = i + L
    pie += i + L
print((pie - min_abs_apple))

-import copy - -apple_taste = [L + i for i in range(N)] -pie_taste = sum(apple_taste) -min_diff = 100000 +pie = 0 +min_abs = 10000 +min_abs_apple = None -    ap = copy.deepcopy(apple_taste) -    ap[i] = 0 -    pie_taste2 = sum(ap) -    diff = abs(pie_taste - pie_taste2) -    if diff < min_diff: -        min_diff = diff -        min_index = i -apple_taste[min_index] = 0 -print((sum(apple_taste))) +    if min_abs > abs(i + L): +        min_abs = abs(i + L) +        min_abs_apple = i + L +    pie += i + L +print((pie - min_abs_apple))