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

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

s=sum(v)

ans=10**9

for i in range(N):

    if abs(s-(s-v[i]))<abs(s-ans):

        ans=s-v[i]

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()))
v = [L + i for i in range(N)]
s = sum(v)
ans = 10**9
for i in range(N):
    if abs(s - (s - v[i])) < abs(s - ans):
        ans = s - v[i]
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)

-s = sum(v) -ans = 10**9 -for i in range(N): -    if abs(s - (s - v[i])) < abs(s - ans): -        ans = s - v[i] +ans = sum(v) - min(v, key=abs)