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



apple_taste = []



for i in range(N):

    taste = L + i + 1 - 1

    apple_taste.append(taste)

    

import numpy as np



abs_apple_taste = np.abs(apple_taste)

m = min(abs_apple_taste)



for j in range(N):

    if m == abs_apple_taste[j]:

        apple_taste.remove(apple_taste[j])



pie_taste = 0       



for k in range(N-1):

    pie_taste += apple_taste[k]

    

print(pie_taste)
n,l = list(map(int,input().split()))

ans = l

eat = l



for i in range(n-1):

    l += 1

    ans += l

    

    if abs(l) < abs(eat):

        eat = l

        

print((ans-eat))
N, L = list(map(int, input().split()))
apple_taste = []
for i in range(N):
    taste = L + i + 1 - 1
    apple_taste.append(taste)
import numpy as np

abs_apple_taste = np.abs(apple_taste)
m = min(abs_apple_taste)
for j in range(N):
    if m == abs_apple_taste[j]:
        apple_taste.remove(apple_taste[j])
pie_taste = 0
for k in range(N - 1):
    pie_taste += apple_taste[k]
print(pie_taste)

n, l = list(map(int, input().split()))
ans = l
eat = l
for i in range(n - 1):
    l += 1
    ans += l
    if abs(l) < abs(eat):
        eat = l
print((ans - eat))

-N, L = list(map(int, input().split())) -apple_taste = [] -for i in range(N): -    taste = L + i + 1 - 1 -    apple_taste.append(taste) -import numpy as np - -abs_apple_taste = np.abs(apple_taste) -m = min(abs_apple_taste) -for j in range(N): -    if m == abs_apple_taste[j]: -        apple_taste.remove(apple_taste[j]) -pie_taste = 0 -for k in range(N - 1): -    pie_taste += apple_taste[k] -print(pie_taste) +n, l = list(map(int, input().split())) +ans = l +eat = l +for i in range(n - 1): +    l += 1 +    ans += l +    if abs(l) < abs(eat): +        eat = l +print((ans - eat))