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

ans = 0

min = L



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

    a = L+i-1

    ans += a

    if abs(a) < abs(min):

        min = a



ans -= min

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

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

ans = sum(v) - min(v, key=abs)

print(ans)

N, L = list(map(int, input().split()))
ans = 0
min = L
for i in range(1, N + 1):
    a = L + i - 1
    ans += a
    if abs(a) < abs(min):
        min = a
ans -= min
print(ans)

N, L = list(map(int, input().split()))
v = [L + i for i in range(N)]
ans = sum(v) - min(v, key=abs)
print(ans)

-ans = 0 -min = L -for i in range(1, N + 1): -    a = L + i - 1 -    ans += a -    if abs(a) < abs(min): -        min = a -ans -= min +v = [L + i for i in range(N)] +ans = sum(v) - min(v, key=abs)