import numpy as np

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

taste = np.array([l+i-1 for i in range(1,n+1)])

taste[np.fabs(taste).argmin()]=0

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

taste = [l+i for i in range(0,n)]

taste.sort(key=lambda x:abs(x))

print((sum(taste[1:])))
import numpy as np

n, l = list(map(int, input().split()))
taste = np.array([l + i - 1 for i in range(1, n + 1)])
taste[np.fabs(taste).argmin()] = 0
print((taste.sum()))

n, l = list(map(int, input().split()))
taste = [l + i for i in range(0, n)]
taste.sort(key=lambda x: abs(x))
print((sum(taste[1:])))

-import numpy as np - -taste = np.array([l + i - 1 for i in range(1, n + 1)]) -taste[np.fabs(taste).argmin()] = 0 -print((taste.sum())) +taste = [l + i for i in range(0, n)] +taste.sort(key=lambda x: abs(x)) +print((sum(taste[1:])))