import numpy as np

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

apple = np.array(list(range(N))) + 1

taste = apple + L - 1

taste_applepie = sum(taste)

if L <= 0 and abs(N) > abs(L):

    print(taste_applepie)

elif L > 0:

    print((taste_applepie - L))

else:

    print((taste_applepie - (N+L-1)))
N,L = list(map(int,input().split()))

t = [L+i-1 for i in range(1,N+1)]

abst = list(map(abs,t))

minind = abst.index(min(abst))

print((sum(t)-t[minind]))
import numpy as np

N, L = list(map(int, input().split()))
apple = np.array(list(range(N))) + 1
taste = apple + L - 1
taste_applepie = sum(taste)
if L <= 0 and abs(N) > abs(L):
    print(taste_applepie)
elif L > 0:
    print((taste_applepie - L))
else:
    print((taste_applepie - (N + L - 1)))

N, L = list(map(int, input().split()))
t = [L + i - 1 for i in range(1, N + 1)]
abst = list(map(abs, t))
minind = abst.index(min(abst))
print((sum(t) - t[minind]))

-import numpy as np - -apple = np.array(list(range(N))) + 1 -taste = apple + L - 1 -taste_applepie = sum(taste) -if L <= 0 and abs(N) > abs(L): -    print(taste_applepie) -elif L > 0: -    print((taste_applepie - L)) -else: -    print((taste_applepie - (N + L - 1))) +t = [L + i - 1 for i in range(1, N + 1)] +abst = list(map(abs, t)) +minind = abst.index(min(abst)) +print((sum(t) - t[minind]))